HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList\
.bak is old profile
System>Advanced System Settings> Advanced> User Profiles Settings
HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList\
.bak is old profile
System>Advanced System Settings> Advanced> User Profiles Settings
dsquery computer -limit 2000 > allcomputers.txt
Then so
dsquery computer -inactive 4 -limit 1000 > inactivecomputers.txt
inactive 4 selects computers inactive for more than 4 weeks.
Then compare them to find the active ones.
Get-ADGroup -Filter {name -like “*”} > C:\Scripts\Glist.txt
name-like value can be changed for narrowing down Group Names such as Account* will include all Accounting.US, Accounting.International, etc
Notepad++- Bookmark lines containing “SamAccountName”, remove Unbookmarked lines, Replace “SamAccountName : ” with nothing and save.
Then as a script run:
$groups = Get-Content c:\Scripts\Glist.txt
foreach($Group in $Groups) {
Get-ADGroupMember -Id $Group | select @{Expression={$Group};Label=”Group Name”},* | Export-CSV c:\Scripts\GroupsInfo.CSV -Append -Force -NoTypeInformation
}