Hi everybody
I have this script:
$out = @()
Get-Content D:\Tools\Reportes_Power_Shell\Contenedor_Power_Shell\Users.txt | ForEach {
$date = (Get-Date).ToString()
$username = $_
$displayName = (Get-QADUser $username -Properties DisplayName).DisplayName
$groups = Get-QADMemberOf $username | Sort-Object Name
ForEach ( $group in $groups ) {
$obj = New-Object -TypeName PSObject
$obj | Add-Member -MemberType NoteProperty -Name Date -Value $date
$obj | Add-Member -MemberType NoteProperty -Name UserName -Value $username
$obj | Add-Member -MemberType NoteProperty -Name DisplayName -Value $displayName
$obj | Add-Member -MemberType NoteProperty -Name GroupName -Value $group.name
$out += $obj
}
}
$out | Export-CSV D:\Tools\Reportes_Power_Shell\Reportes_de_Power_Shell_y_AD_Info\Users_Memberships.csv
What I need now is exactly the opposite, I need to put Groups in a container and in the same format list all users within plus the cmdlet "AccountIsDisabled". I need this ASAP, could you help me?
Thanks a lot.