hi guys
I need some help with a script
i would like to make a script which list ALL computers and application within an department. This script does the trick
$out = @()
Get-ADComputer -Filter "Name -like 'ATANS*'" -Properties memberOf | ForEach {
$server = $_
foreach ($group in $server.memberOf) {
$props = @{
'Server Name' = $server.Name
'Group Name' = (Get-ADGroup $group).Name
}
$out += New-Object PsObject -Property $props
}
}
$out | Sort-Object 'Server Name' | Export-Csv .\serverGroupMemberships.csv -NoTypeInformationFurther i like to use the computername from this csv file and to look for who is the owner of the machine.
The machine name have the syntax(SITENAME-USERNMAME-xx)
If possible i like to have the username infomration stored within the same excel colum as the machinename
Hope someone can help me out here
Update: Is this is to difficult i could maybe use a script which can show me the spreadsheet like this