Remote PowerShell is now available
Started by Andrew
Remote PowerShell is now available 18 September 2015, 18:20 |
Admin Registered: 18 years ago Posts: 3 519 |
Re: Remote PowerShell is now available 18 September 2015, 23:40 |
Registered: 11 years ago Posts: 56 |
Re: Remote PowerShell is now available 19 September 2015, 00:05 |
Registered: 11 years ago Posts: 56 |
Error: [10.46.3.40] Connecting to remote server 10.46.3.40 failed with the following error message : The WinRM client cannotprocess the request. Default authentication may be used with an IP address under the following conditions: the, transport is HTTPS or the destination is in the TrustedHosts list, and explicit credentials are provided. Use, winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. For more, information on how to set TrustedHosts run the following command: winrm help config. For more information, see the, about_Remote_Troubleshooting Help topic., + CategoryInfo : OpenError: (10.46.3.40:String) [], PSRemotingTransportException, + FullyQualifiedErrorId : CannotUseIPAddress,PSSessionStateBroken
Re: Remote PowerShell is now available 21 September 2015, 11:41 |
Admin Registered: 18 years ago Posts: 3 519 |
I have now changed the behaviour that a host name is used first if available. If it's not available, then an IP address is used. I also added an SSL connection option, though that requires additional steps in setting up PowerShell.
The updated build can be downloaded here.
Re: Remote PowerShell is now available 21 September 2015, 21:01 |
Registered: 11 years ago Posts: 56 |
Error: [lds-edit-382.eng.jpress.co.uk] Connecting to remote server lds-edit-382.eng.jpress.co.uk failed with the followingerror message : The connection to the specified remote host was refused. Verify that the WS-Management service is, running on the remote host and configured to listen for requests on the correct port and HTTP URL. For more, information, see the about_Remote_Troubleshooting Help topic., + CategoryInfo : OpenError: (lds-edit-382.eng.jpress.co.uk:String) [], PSRemotingTransportException, + FullyQualifiedErrorId : CannotConnectWinRMService,PSSessionStateBroken
Re: Remote PowerShell is now available 21 September 2015, 21:58 |
Admin Registered: 18 years ago Posts: 3 519 |
Re: Remote PowerShell is now available 22 September 2015, 00:47 |
Registered: 11 years ago Posts: 56 |
WinRM QuickConfig -quietAfter that, the Netscan PowerShell commands work fine.
I guess the client WinRM configuration would have to be set using Group policy? In the short-term I'll add a psexec command to Netscan to active on remote clients. (Is there any way it can be forced by the powershell command?)
Rgds
John
Re: Remote PowerShell is now available 22 September 2015, 09:08 |
Admin Registered: 18 years ago Posts: 3 519 |
rmpf2
Re: Remote PowerShell is now available 25 September 2015, 00:08 |
%PsExec_VAR \\%0 -u %USER -p %PWD -s powershell -command "Enable-PSRemoting -Force"%PsExec_VAR = variable defined on NS (Thanks Andrew!!!) for the psexec executable and its path.
%USER = variable defined on NS for the user with admin privileges to run scripts on target machine.
%PWD = variable defined on NS for the user password with admin privileges to run scripts on target machine.
Now I can see the results of the Remote PowerShell NS new support feature (Thanks Andrew!!!).
The statement assigns the proper rights. Change the default state of WinRM service to auto and running. Write an exception into the firewall policy. Etc...
Scott
Re: Remote PowerShell is now available 30 September 2015, 04:32 |
rmpf2
Re: Remote PowerShell is now available 06 October 2015, 06:31 |
1) Any idea on the following statement:
gwmi win32_useraccount | where {$_.caption -match $env:USERNAME} | select fullname | ft -HideTableHeaders
It works just over my own machine scan on the rest of the lan host the results appear blank.
2) I believe for this one Powershell AD module should be imported. Any idea on how to do it for NS powershell feature.
Get-ADUser $User.Users -Properties MemberOf | Select -ExpandProperty memberof
Re: Remote PowerShell is now available 06 October 2015, 10:35 |
Admin Registered: 18 years ago Posts: 3 519 |
rmpf2
Re: Remote PowerShell is now available 08 October 2015, 01:57 |
Based on your last comment (Invoke-Command -ComputerName computer-name -ScriptBlock { command-text; })
I would like to know if support for NS defined variables are already included?
For example to include [logged user] as a parameter inside "-ScriptBlock { command-text; }" instead of username system/enviroment variable.
Another idea....
Following your advice i did some test over a ps console and get some results querying the domain controller instead of the scanned host. Of course using the logged user of the machine being scanned but this can not be done inside NS as it is right now cause in its design is asumming -ComputerName to be always the scanned machine. Any idea on how to bypass default value for -ComputerName to establish a new one.
Example:
Invoke-Command -ComputerName 'DCServerName' -ScriptBlock { Get-ADUser -identity '[Logged User]'}
Thanks!!!
Re: Remote PowerShell is now available 08 October 2015, 10:41 |
Admin Registered: 18 years ago Posts: 3 519 |
Regarding using DC instead of a target computer, I guess it makes sense for few scan types. This would require passing column variables though, which isn't currently available.
APunjwani
Re: Remote PowerShell is now available 23 September 2016, 04:55 |
1st of all, many thanks for this amazing free tool you guys have put together.
I would like to use some of my Powershell CMDLets to return value from its session into the Netscan. Is that possible?
For example, I have "HP Lights-Out Powershell CMDLets" installed on my computer. I can send commands using "Program Options > Applications" to iLOs for upgrades. I would like to leverage those same CMDlets to report/Configure SNMP string.
$SNMPROString = $(Get-HPiLOSNMPIMSetting -server 192.168.2.25 -username admin -password Password -DisableCertificateAuthentication).SNMP_ADDRESS_1_ROCOMMUNITY
I would like the $SNMPROString value to be listed. Is that possible?
Thanks again.
-A
Re: Remote PowerShell is now available 23 September 2016, 09:11 |
Admin Registered: 18 years ago Posts: 3 519 |
Perhaps something like echo $(Get-HPiLOSNMPIMSetting -server 192.168.2.25 -username admin -password Password -DisableCertificateAuthentication).SNMP_ADDRESS_1_ROCOMMUNITY might work.