added checks for groups, users and fileshare.

This commit is contained in:
Gramzon
2025-01-31 12:43:26 +01:00
parent f9af5f3a7d
commit 95361f9bec
3 changed files with 295 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
# Get all Organizational Units (OUs) and their details
Get-ADOrganizationalUnit -Filter * -Properties CanonicalName | ForEach-Object {
$ou = $_
Write-Host "OU: $($ou.Name), Path: $($ou.DistinguishedName)"
# Get and display user objects in the OU
Get-ADUser -Filter * -SearchBase $ou.DistinguishedName | ForEach-Object {
Write-Host "`tUser: $($_.Name)"
}
# Get and display group objects in the OU
Get-ADGroup -Filter * -SearchBase $ou.DistinguishedName | ForEach-Object {
Write-Host "`tGroup: $($_.Name)"
}
Write-Host ""
}