All Questions

Filter by
Sorted by
Tagged with
32 votes
5 answers
59k views

Managing Windows Powershell from Linux terminal

I manage Windows Server 2012 servers. I'm learning PowerShell to manage these servers through command line. My workstation runs Ubuntu and I usually manage Linux servers by connecting via SSH. Is ...
Ederson's user avatar
  • 575
18 votes
6 answers
94k views

Enabling Powershell Remoting, Access is denied?

I am trying to enable Powershell remoting on a Windows 2008 R2 Server, running in workgroup mode. I ran the command Enable-PSRemoting in the PowerShell Console. PS C:\Windows\system32> Enable-...
user avatar
16 votes
2 answers
9k views

How to persist credentials in a remote Powershell session?

I have an Azure File Share and would like to use this from my Azure VMs - after persisting the credentials on the VMs with cmdkey and mounting with net use. This was tested by running these commands ...
Razvan Zoitanu's user avatar
12 votes
1 answer
6k views

Windows Remote Management Over Untrusted Domains

I am currently trying to enable Windows Remote Management (specifically, Powershell Remoting) between 2 untrusted domains, and having no luck. A brief description of my setup: domain1 - my ...
Nick DeMayo's user avatar
8 votes
6 answers
29k views

Powershell Get-Process : Couldn't connect to remote machine

Been struggling with this for a couple days now. I'm getting the following error: PS C:\> get-process -ComputerName Win2012r2 get-process : Couldn't connect to remote machine. At line:1 char:1 +...
StormeHawke's user avatar
8 votes
2 answers
6k views

Test for Localhost in Powershell?

I have a powershell script that calls Get-WmiObject with -Credential. However, this errors out if I am running it against the local machine: Get-WmiObject : User credentials cannot be used for local ...
Kyle Brandt's user avatar
  • 83.8k
7 votes
4 answers
11k views

How can I run a PowerShell function remotely?

Using powershell, I plan to run many functions on a remote host to gather information. Here is an example to retrieve the content of file remotely just by running a function called getcontentfile ...
Aimar's user avatar
  • 71
7 votes
1 answer
2k views

How to rejoin domain when trust relationship is lost

I have a number of virtual machines which have snapshots applied by using a PowerShell script. Occasionally, the virtual machines lose their "trust relationship" with the domain. This breaks the ...
tnw's user avatar
  • 213
7 votes
3 answers
27k views

Automatically reconfigure WinRM HTTPS listener with new certificate?

I am looking to enable WinRM HTTPS listeners on all of our servers for secure communication when using CredSSP between servers to get around the double-hop issue. Setting this up is fine, we have CN-...
Jared's user avatar
  • 71
7 votes
2 answers
51k views

How do I run commands on a remote machine with admin privilege using powershell

How do I run commands on a remote machine with admin privilege (example: running as Run as Administrator) using PowerShell. So far I have tried start-process powershell.exe -verb runas -...
rakesh's user avatar
  • 73
6 votes
5 answers
63k views

Unable able to run remote Powershell using Active Directory

We are trying to connect to a remote server via Powershell and use the ActiveDirectory module. When trying to do this locally, everything seems to be fine. PS C:\Users\bar> Import-Module ...
Mark's user avatar
  • 163
6 votes
3 answers
3k views

Powershell remoting suddenly stops working

I'm having trouble executing a remote powershell script which is supposed to update the installation of an application for automated testing in a taskmanager task running once a day. The rather ...
Thomas's user avatar
  • 161
5 votes
6 answers
52k views

Execute program on remote computer using PowerShell

How can I execute a program on a remote machine using powershell?
Muhammad Hasan Khan's user avatar
5 votes
1 answer
4k views

How can I connect to a cisco switch via serial console cable from powershell?

I don't actually need to perform any operations on the switch. I just need to verify it's there. I have some remote servers that I need to verify have the blue serial console cable hooked up ...
MathewC's user avatar
  • 6,977
5 votes
4 answers
5k views

Why can a Domain Admin run a powershell cmd locally, but connecting over WinRM with the same account, command returns an UnauthorizedAccessException?

I'm trying to administer a Windows 7 machine remotely. I've enabled WinRM and can use Enter-PsSession to connect to the remote machine. However, I'm noticing a difference between running a particular ...
growse's user avatar
  • 8,030
5 votes
1 answer
4k views

Remove Server 2012 Remote Access Server

My IT director was walking me through setting up a Server 2012 VPN/RA server. We did not do this in our test environment, and now I would like to remove it. I know that when installing this server it ...
James Edmonds's user avatar
4 votes
3 answers
20k views

Why does my PowerShell script hang when called in PSEXEC via a batch (.cmd) file?

I'm trying to remotely execute a PowerShell script using PSEXEC. The PowerShell script is called via a .cmd batch file. The reason we do this is to change the execution policy, run the powershell ...
Kev's user avatar
  • 7,887
4 votes
2 answers
8k views

Can I RDP through mstsc and run a script on that remote desktop?

I'm writing a powershell script which needs to RDP to a few servers and do processes there and then come back. mstsc /v:<computer> by itself looks great as it's security/credential prompt is ...
Ryan's user avatar
  • 43
4 votes
1 answer
2k views

How can I grant Dial-In / Network Access Permission to local account via command line?

I am trying to configure a VPN server completely using Powershell. I have completed everything except the last step: Granting a local user account Dial-In / Network Access Permissions so that this ...
Adrian Grigore's user avatar
3 votes
4 answers
8k views

How can I use shared functions in a remote Powershell session?

I have some Powershell scripts for setting up IIS web applications, message queues, etc. They use a set of shared function libraries we've created - so each script starts with the line . .\common....
Dylan Beattie's user avatar
3 votes
3 answers
2k views

One-To-Many Powershell Scripts

I'm trying to create a script to run as a scheduled task, which will run against multiple servers and retrieve some information. To start with, I populate the list of servers by querying AD for all ...
Matt's user avatar
  • 1,893
3 votes
3 answers
2k views

Automating help desk tasks using a Powershell web interface

I'm looking into implementing Powershell in a help desk environment to automate routine tasks like unlocking user accounts, resetting passwords, etc. The help desk will be supporting different ...
Zero Subnet's user avatar
3 votes
1 answer
222 views

How to install remote software NOT on a domain?

I have a situation where some software (that I wrote) is going to be deployed on 60 laptops for an event. The laptops are all running windows 7, but there is no domain controller, and they will all ...
Nicros's user avatar
  • 133
3 votes
3 answers
25k views

WinRM will not connect to remote computer in my Domain

I am trying to run a script that installs a program remotely for a user in my domain. I can run the script fine on my own computer but when I run the script for a different computer in the domain I ...
josh's user avatar
  • 51
3 votes
3 answers
16k views

Remote Powershell not working but test-wsman does

I need to script some routine task to execute remotly from a serverA to many hosts but a couple of them fail to execute the script. If i execute this: $cred = Get-Credential myUser Invoke-Command -...
Nico Osorio's user avatar
3 votes
2 answers
11k views

Why some servers fail when execute "Get-Service"?

I have several servers connected in VPN to my host server. All run windows 7. I'm running in loop Get-Service -ComputerName $server -Name Spooler for each server. For some reason some of them return ...
theateist's user avatar
  • 163
3 votes
1 answer
2k views

How do I stop service on remote server, that's not connected to a domain, using a non admin user via PowerShell

I've got the start of the script to achieve this: $SecurePassword = ConvertTo-SecureString –String $Password –AsPlainText -Force $Credential = New-Object -TypeName System.Management.Automation....
Wayne Scott's user avatar
3 votes
1 answer
1k views

remote Powershell script Scheduled task

I am having trouble running a Powershell script as a scheduled task. The script remotely logs into two Hyper-V hosts, queries the replication status and emails the result back to me. The script works ...
Bilbo Bongo's user avatar
2 votes
4 answers
15k views

Get OS architecture remotely via PowerShell

Does anybody know how to grab OS architecture remotely from multiple Windows hosts via PowerShell?
Volodymyr Molodets's user avatar
2 votes
3 answers
3k views

Powershell authentication over VLAN

Problem I'd like to enable remote powershell scripting for all workstation hosts on a VLAN. There's no Active Directory or Directory services whatsoever. So HOST A on subnet 192.168.1.x would like ...
Bubnoff's user avatar
  • 415
2 votes
1 answer
1k views

Enable-PSRemoting: Is there security threats?

I have two production servers (Windows Server 2008, Terminal Servers) and I would like to enable PowerShell remoting commands on those servers. Is there a security threat one should consider before ...
jrara's user avatar
  • 209
2 votes
1 answer
550 views

Manage a DC remotely via powershell on a computer not joined to the domain

What should be done? Is it possible?
Parsa's user avatar
  • 641
2 votes
1 answer
288 views

Implementing Powershell .20 (WinRM Invoke-Item) in the secure Datacenter environment

How do you secure your Windows domain environment while still enabling the Powershell 2.0 remoting capabilities (WinRM invoke-item) ? Because at the moment my company datacenter would like to ...
Senior Systems Engineer's user avatar
2 votes
1 answer
223 views

Manage client workstations with Remote Powershell via SSL

I am looking for a solution to remotely manage around 100 workstations. I will be connecting to these systems to complete several local system tasks. (3rd party updates, security auditing, incident ...
tcshain's user avatar
  • 31
2 votes
1 answer
7k views

Powershell - Query remote Local Security Policy?

I am looking to remotely query a list of servers, to ensure they are "set up" correctly One of the things I want to check is the Local Security Policy -> User Rights Assignment ->Deny Log on through ...
Dan Black's user avatar
  • 123
2 votes
2 answers
4k views

powershell v2 remoting - How do you enable unecrypted traffic

I'm writing a powershell v2 script that I'd like to run against a remote server. When I run it, I get the error : Connecting to remote server failed with the following error message : The ...
Peter Walke's user avatar
2 votes
0 answers
5k views

WinRM will not connect to remote machine

I had posted a question but it hasn't been answered and there has been no activity on it lately so I'm reposting. Sorry if thats the incorrect way of doing things but I have been struggling to get ...
josh's user avatar
  • 51
2 votes
0 answers
777 views

Powershell command works in local PS prompt, but not in a remote PS prompt

I am just beginning to use PS Remoting to administer servers but have run into a snag. When I am at the local server command line, I can run a command like Get-DfsReplicationGroup and the prompt ...
bsigrist's user avatar
  • 235
2 votes
1 answer
1k views

Using remote's computer proxy when Powershell remoting to this computer

I'm trying to do the following tasks: Connect to a remote computer through Powershell ISE 4 Then run a ps1 script in that computer, that installs chocolatey and update other software This machine is ...
SarsaJP's user avatar
  • 23
1 vote
3 answers
4k views

Enter-PSSession: receiving access denied on non domain remote server

I am struggling to open a remote PS session on a remote server (Windows Server 2022 Standard). The remote server is not part of a domain. When running the command Enter-PSSession -ComputerName ...
Abid's user avatar
  • 125
1 vote
3 answers
5k views

Can I run remote PowerShell/Cmd command with RDP credential, without Remote PS enabled?

I am in a "funny" situation where I have RDP credentials of about 200 servers, but none of them have Remote Powershell enabled. I need a simple task: restart them all. But all I have is RDP (...
Luke Vo's user avatar
  • 159
1 vote
1 answer
6k views

PowerShell - Invoke-WmiMethod : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

I have 2 workgroup computers. I want to setup powershell-remoting between these two computers. The OS on both the computer is windows 1809. Powershell remoting is enabled in one of the computer. ...
Harshith R's user avatar
1 vote
1 answer
711 views

My Powershell Script of Adding Domain Users to Remote Machine is Failing with Access Denied

I have the following script: Param( [String[]] $targetMachines, [String] $targetMachineListFile, [String] $group, [String] $domain, [String] $user ) if (-not ($targetMachines)) { ...
Husain's user avatar
  • 113
1 vote
1 answer
2k views

Notes 6: Anyway to access the Lotus Notes server console via Telnet/SSH/WMI/Powershell?

I'm trying to automate a lot of tasks at my new company using Powershell. So far, I've had a lot of success with their server and network monitoring, but one thing that alludes me is whether they is ...
Jeshizaemon's user avatar
1 vote
0 answers
39 views

Is it possible to configure a machine wide WinRM client default authentication?

WinRM is the protocol used by Windows Machine when running remote commands, WinRM supports several authentication schemes. Is there a machine wide setting to control the default authentication ...
Chedy2149's user avatar
  • 223
1 vote
1 answer
1k views

Remote power shell through load balancer

I want to connect to exchange server via remote Powershell. When I connect directly with server URL I am able to create the session. But in the production I have many instances of exchange server, So ...
Mak's user avatar
  • 111
1 vote
1 answer
713 views

Why is New-PSSession working? Where do the ApplicationName and ConfigurationName parameters map to?

I know this is probably a bit unusual for a StackExchange question... but my PowerShell command is working and I can't figure out why! The below command executes fine and I can connect to the server ...
Pseudonymous's user avatar
1 vote
2 answers
129 views

Local PC cannot connect to new Azure VM just created. Error-....server name cannot be resolved

Standard disclaimer, very new with powershell and Azure remote machines. Here is my powershell script. It is failing on this command: $setupSession = New-PSSession -ComputerName $pip -Port 5986 -...
Greg P's user avatar
  • 121
1 vote
0 answers
619 views

Running apps on remote machine using current user credentials

I'm using enter-pssession to connect to a remote machine via Powershell. I then try to run an application via this connection on the remote machine. However, when I do this, it believes the user is ...
MgSam's user avatar
  • 141
1 vote
1 answer
2k views

Error in getting powershell remote session through ssh-enabled PowerShell

I am trying to login to windows 2008 server "C" from my machine "A". There is machine in between "B" serving as jumpbox running windows server 2008 and running "SSH-Enabled PowerShell Access for ...
tollboy's user avatar
  • 76