powershell using adsi with alternate credentials
hi,
i check local admin groups on list of servers in domain.
i have domain admin account there.
i found script snippet get's info me in domain loged on to.
$computer = [adsi]("winnt://" + $strcomputer + ",computer")
$group = $computer.psbase.children.find("administrators")
$members= $group.psbase.invoke("members") | %{$_.gettype().invokemember("name", 'getproperty', $null, $_, $null)}
is there way supply alternate credentials query? or there method this?
old dog
1)psexec
2)invoke-command -credentials
Windows Server > Windows PowerShell
Comments
Post a Comment