Mirceyhun Musayev
asked on
Exporting script output to csv
Hi, i have script for get all groups that a user is member of. Works correctly, but i cant export it to csv file. output shows PS terminal just. any ideas what i exactly must add to script?
Import-Module ActiveDirectory
Get-ADUser -SearchBase "OU=Users,DC=domain,DC=loc al" -Filter * | foreach-object {
write-host "User:" $_.Name -foreground green
Get-ADPrincipalGroupMember ship $_.SamAccountName | foreach-object {
write-host "Member Of:" $_.name
}
}
Import-Module ActiveDirectory
Get-ADUser -SearchBase "OU=Users,DC=domain,DC=loc
write-host "User:" $_.Name -foreground green
Get-ADPrincipalGroupMember
write-host "Member Of:" $_.name
}
}
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER