Private/Get-USERInformation.ps1
function Get-USERInformation { $userData = Get-ADUser -Filter * -Properties * $userOutput = foreach ($data in $userData) { [PSCustomObject] @{ 'AccountExpirationDate' = $data.AccountExpirationDate 'AccountLockoutTime' = $data.AccountLockoutTime 'AccountNotDelegated' = $data.AccountNotDelegated 'AllowReversiblePasswordEncryption' = $data.AllowReversiblePasswordEncryption 'BadLogonCount' = $data.BadLogonCount 'CannotChangePassword' = $data.CannotChangePassword 'CanonicalName' = $data.CanonicalName 'Certificates' = $data.Certificates 'ChangePasswordAtLogon' = $data.ChangePasswordAtLogon 'City' = $data.City 'CommonName' = $data.cn 'Company' = $data.Company 'Country' = $data.Country 'DesktopProfile' = $data.DesktopProfile 'Department' = $data.Department 'Description' = $data.Description 'DirectReports' = $data.DirectReports 'DisplayName' = $data.DisplayName 'DistinguishedName' = $data.DistinguishedName 'Division' = $data.Division 'DoesNotRequirePreAuth' = $data.DoesNotRequirePreAuth 'EmailAddress' = $data.EmailAddress 'EmployeeID' = $data.EmployeeID 'EmployeeNumber' = $data.EmployeeNumber 'Enabled' = $data.Enabled 'Fax' = $data.Fax 'GivenName' = $data.GivenName 'GroupMembershipSAM' = $data.groupMembershipSAM 'HomeDirectory' = $data.HomeDirectory 'HomeDirRequired' = $data.HomeDirEnabled 'HomeDrive' = $data.HomeDrive 'HomePage' = $data.HomePage 'HomePhone' = $data.HomePhone 'LastBadPasswordAttempt' = $data.LastBadPasswordAttempt 'LastKnownParent' = $data.LastKnownParent 'LastLogOn' = $data.LastLogOn 'LastLogOff' = $data.LastLogOff 'LastLogonDate' = $data.LastLogonDate 'LockedOut' = $data.LockedOut 'LockoutTime' = $data.LockoutTime 'LogonHours' = $data.LogonHours 'LogonWorkstations' = $data.LogonWorkstations 'Manager' = $data.Manager 'MemberOf' = $data.MemberOf 'MobilePhone' = $data.MobilePhone 'Name' = $data.Name 'ObjectCategory' = $data.ObjectCategory 'ObjectClass' = $data.ObjectClass 'ObjectGuid' = $data.ObjectGuid 'Office' = $data.Office 'OfficePhone' = $data.OfficePhone 'Organization' = $data.Organization 'OtherName' = $data.OtherName 'PasswordExpired' = $data.PasswordExpired 'PasswordLastSet' = $data.PasswordLastSet 'PasswordNeverExpires' = $data.PasswordNeverExpires 'PasswordNotRequired' = $data.PasswordNotRequired 'POBox' = $data.POBox 'PostalCode' = $data.PostalCode 'PrimaryGroup' = $data.PrimaryGroup 'ProfilePath' = $data.ProfilePath 'ProtectedFromAccidentalDeletion' = $data.ProtectedFromAccidentalDeletion 'SamAccountName' = $data.SamAccountName 'ScriptPath' = $data.ScriptPath 'ShowInAdvancedViewOnly' = $data.showInAdvancedViewOnly 'ServicePrincipalName' = $data.ServicePrincipalName 'SID' = $data.SID 'SIDHistory' = $data.SIDHistory 'SmartcardLogonRequired' = $data.SmartcardLogonRequired 'State' = $data.State 'StreetAddress' = $data.StreetAddress 'Surname' = $data.Surname 'ThumbnailPhoto' = $data.ThumbnailPhoto 'ThumbnailLogo' = $data.ThumbnailLogo 'Title' = $data.Title 'TrustedForDelegation' = $data.TrustedForDelegation 'TrustedToAuthForDelegation' = $data.TrustedToAuthForDelegation 'UserAccountControl' = $data.UserAccountControl 'UseDESKeyOnly' = $data.UseDESKeyOnly 'UserPrincipalName' = $data.UserPrincipalName 'whenCreated' = $data.whenCreated 'whenChanged' = $data.whenChanged } } $userOutput } |