get-wmiobject to remote servers using different user name and password


hi there:

  pretty newbie powershell on sql server. have dba script using get-wmiobject cmdlet . right now, powershell script running under windows scheduled task using default account. howerver, default account not have access few remote servers. 

 my question how force get-wmiobject run under different username , password?

 any ideas?

thanks


--currently using reporting service 2000; visual studio .net 2003; visual source safe ssis 2008 ssas 2008, svn --

hi,

get-wmiobject has -credential parameter can use:

http://ss64.com/ps/get-wmiobject.html


edit: or set task run domain account.

don't retire technet! - (don't give yet - 13,085+ strong , growing)



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS