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

Popular posts from this blog

Motherboard replacement

Cannot create Full Text Search catalog after upgrading to V12 - Database is not fully started up or it is not in an ONLINE state

Remote Desktop App - Error 0x207 or 0x607