Jump to content

peterdigby

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by peterdigby

  1. Thank you for pointing me in the right direction of checking for the AD group. The AD group i was using had been moved into a sub-OU, causing the issue. Once i had the correct path to the security group, everything worked as required. If anyone else needs the full code, it is # Group Check $Group = [ADSI]"LDAP://cn=IT Alerts,OU=Groups,OU=domain" $Group.Member | ForEach-Object { if ($user.distinguishedname -match $_) { $ItStaff = $true } } $Group = [ADSI]"LDAP://cn=Human Resources,OU=Groups,OU=domain" $Group.Member | ForEach-Object { if ($user.distinguishedname -match $_) { $HRStaff = $true } } and in the signature generation area $(if($ITStaff){"IT Helpdesk"+" |"}) $(if($HRStaff){"Human Resources"+" |"}) Thanks again. Peter Digby
  2. (Hopefully) one final question. Is it possible to have more than one 'Group Check' for different departments? Currently using the Group Check for the IT Department with the modified code of $Group = [ADSI]"LDAP://OU=Information Technology,OU=domain" $Group.Member | ForEach-Object { if ($user.distinguishedname -match $_) { $ItStaff = $true } } and $(if($ITStaff){"IT Helpdesk"+" |"}) and it is working as expected. I have tried setting up a second Group Check with the following; but it includes both the IT and HR details. $Group2 = [ADSI]"LDAP://cn=HR,OU=domain" $Group2.Member | ForEach-Object { if ($user.distinguishedname -match $_) { $HRStaff = $true } } and $(if($HRStaff){"Human Resources"+" |"}) Is there a way to have the script check multiple departments; but only add the specific info for each department? Thanks again, Peter Digby
  3. Copied your code and worked perfectly. Thanks again for your help on this. Regards, Peter Digby
  4. Thanks for the reply, and sorry I copied the incorrect code. Please put it down to frustration and lack of sleep. The code i am currently running is if($user.Fax.count -gt 0){$faxnumber = $user.Fax[0]} and $(if($faxnumber){"F: $($faxnumber)"}) I have removed the 'if' statement from the Building HTML section and the text shows; but not the fax number. Thanks again, Peter Digby
  5. Thank you so much for sharing this script. I have modified it and it is working well; but I was wondering if there was a way of adding the fax number to the output. I have tried adding an extra line for if($user.fax.count -gt 0){$fax = $user.faxnumber[0]} using both ‘fax’ and ‘facsimileTelephoneNumber’ as listed using an get-aduser lookup; but the there is nothing in the output to the signature. Can a fax number be added, and do you know what I am missing? Thanks again.
×
×
  • Create New...