Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Compare a Users group membership to a local server

$
0
0

I'm trying to find if a users AD group membership exists on a server.

Does the AD Group XXXX exist in any of the local groups.

Not sure if this is going to be a easy task or a hard task.

 

Clear-Host
# 1. Retrieve groups that the user is a member of
$User = Get-ADUser "user123" -Properties memberOf
$Groups = $User.memberOf
#**************************************************

$userGroups = $groups
$LocalGroup = "Administrators"

# $Servers = Get-Content serverlist.txt
$Servers = $env:computername # for testing on local computer

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles