FAQ FAQ  Forum Search   Register Register  Login Login

Change Pwd Right: Part 2

 Post Reply Post Reply
Author
  Topic Search Topic Search  Topic Options Topic Options
coneh34d View Drop Down
I'm new here
I'm new here


Joined: 31 Aug 2010
Location: United States
Online Status: Online
Posts: 26
  Quote coneh34d Quote  Post ReplyReply bullet Topic: Change Pwd Right: Part 2
    Posted: Today at 03:51
Code works, and handles the nested stuff like it should but I have a snag. Any user outside the domain in which I run the code with the change pwd right is reported as a damn SID. This is a standard international forest with the following structure root.com, amer.root.com, emea.root.com, asia.root.com.
# -------------------------------------------------------------------------------------------------------------
# Get AD Users then enumerate User, Groups, Nested Groups & all Members with Change Pwd Right
#--------------------------------------------------------------------------------------------------------------
#
#
#
Set-QADProgressPolicy –ShowProgress $true –ProgressThreshold 2 | Out-Null
Get-QADUser -size 0 -SearchRoot "OU=aaScriptTest,DC=domaintest,DC=com" | Get-QADPermission -Allow -ExtendedRight "User-Change-Password" -Inherited | Where {$_.account.Name -notmatch "everyone|exchange" } | ForEach {
    if ($_.account.Type -eq 'group')
    {
        return (Get-QADGroupMember $_.account -Indirect)
    }
    else
    {
        return $_.account
    }
} | Export-Csv c:\CSV\Test.csv 


Thanks,
Eric

Back to Top
jhicks View Drop Down
MVP
MVP


Joined: 10 Mar 2010
Location: United States
Online Status: Online
Posts: 3673
  Quote jhicks Quote  Post ReplyReply bullet Posted: Today at 05:27
I believe most of the Quest cmdlets have an option to explicitly query a Global Catalog server.  I wonder if that would help resolve the SID.

Also, I suggest breaking the habit of using 'return'.  You don't need it. If you want to explicitly write to the pipeline, use Write-Output.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down