Powershell GUI for remote-connection


hi folks

i wrote script deploys new server activedirectory based on hostname. creates a

-computeraccount

-6 securitygroups

-changes membership of securitygroups

-creates gpo

-changes gpo filtering

-links gpo server-ou

after jokes, wrote gui script , seems ;-) .

until now, script has run on domaincontroller. last idea make run our jumphosts. tried add textbox specify hostname , button executes "enter-pssession -computername $hostname -credentials $creds" .

is possible? without gui, think shouldn't big deal - when using button?

thanks lot , best regards, sven

hi sven,

you can't use enter-pssession that: it's interactive console use only. use ...

  • new-pssession create session (store session object returns in variable)
  • invoke-command -session parameter run scriptblock on remote system

e.g.:

$session = new-pssession -computername "dcserver" $scriptblock = { param ($computername) # whatever } invoke-command -session $session -scriptblock $scriptblock -argumentlist "newcomputer"

cheers,
fred


there's no place 127.0.0.1



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

0x300000d errors in Microsoft Remote Desktop client