diff --git a/Active-Users.ps1 b/Active-Users.ps1 index 9b49996..4becc5e 100644 --- a/Active-Users.ps1 +++ b/Active-Users.ps1 @@ -1,5 +1,5 @@ -$ADUsers = Get-ADUser -Filter '(mail -like "*mpe.ca")' -Properties mail,title,office -SearchBase 'OU=MPEUsers,DC=mpe,DC=ca' | ` - where name -NotMatch 'Mailbox|Migration|Federated|Boardroom|Presentation|Survey|Conferences|room|safety|helpdesk|sask|quality|vacation|holiday' | select surname, GivenName, name, mail, title,samaccountname +$ADUsers = Get-ADUser -Filter '(mail -like "*mpe.ca")' -Properties mail,title,office,extensionAttribute1,mobile,telephoneNumber -SearchBase 'OU=MPEUsers,DC=mpe,DC=ca' | ` + where name -NotMatch 'Mailbox|Migration|Federated|Boardroom|Presentation|Survey|Conferences|room|safety|helpdesk|sask|quality|vacation|holiday' -$ADUsers | Select-Object name,title,mail,GivenName,surname | sort-object name | Export-Csv -Path '.\Active-Users.CSV' -NoTypeInformation +$ADUsers | Select-Object name,title,mail,GivenName,surname,extensionAttribute1,mobile,telephoneNumber, office | sort-object name | Export-Csv -Path '.\Active-Users.CSV' -NoTypeInformation