New-Item C:\AD_EXPORT -ItemType Directory -Force
Get-ADDomain |
Format-List * |
Out-File C:\AD_EXPORT\domain.txt -Encoding UTF8
Get-ADForest |
Format-List * |
Out-File C:\AD_EXPORT\forest.txt -Encoding UTF8
Get-ADDomainController -Filter * |
Select-Object HostName,IPv4Address,Site,OperatingSystem,IsGlobalCatalog |
Export-Csv C:\AD_EXPORT\domain_controllers.csv -NoTypeInformation -Encoding UTF8
Get-ADUser -Filter * -Properties Enabled,LastLogonDate,PasswordLastSet,DistinguishedName |
Select-Object SamAccountName,Name,Enabled,LastLogonDate,PasswordLastSet,DistinguishedName |
Export-Csv C:\AD_EXPORT\users.csv -NoTypeInformation -Encoding UTF8
Get-ADComputer -Filter * -Properties OperatingSystem,OperatingSystemVersion,IPv4Address,Enabled,LastLogonDate,DistinguishedName |
Select-Object Name,DNSHostName,OperatingSystem,OperatingSystemVersion,IPv4Address,Enabled,LastLogonDate,DistinguishedName |
Export-Csv C:\AD_EXPORT\computers.csv -NoTypeInformation -Encoding UTF8
Get-ADGroup -Filter * -Properties GroupScope,GroupCategory,DistinguishedName |
Select-Object Name,SamAccountName,GroupScope,GroupCategory,DistinguishedName |
Export-Csv C:\AD_EXPORT\groups.csv -NoTypeInformation -Encoding UTF8
Get-ADOrganizationalUnit -Filter * -Properties DistinguishedName |
Select-Object Name,DistinguishedName |
Export-Csv C:\AD_EXPORT\ous.csv -NoTypeInformation -Encoding UTF8