Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
136 views

The following code will launch notepad.exe which can be seen in the processes. But it does not launch the notepad on the screen. $wmi = [WMIClass]"\\REMOTE_MACHINE_NAME\root\cimv2:Win32_Process&...
Abhimanyu's user avatar
1 vote
0 answers
98 views

I am trying to create a Remote PowerShell (RPS) that will form connection between machines to execute RPS Commands. I have this following example setup "HostPC with C# console application (that ...
NeoGenesis521's user avatar
0 votes
2 answers
211 views

I'm trying to run a remote command using Invoke-Command over WSMan in PowerShell on my local machine. Here’s my test script: $server = 'localhost' Invoke-Command -Authentication Negotiate -...
Victor Sanchez's user avatar
2 votes
1 answer
106 views

I have this setup, I have a HostPC which will connect with say two remote PCs in order to run PowerShell commands. So, I will be using WSManConnectionInfo for this with HTTPS. I am just stuck around ...
NeoGenesis521's user avatar
1 vote
0 answers
53 views

We're developing a Windows application environment on EC2s. There is a Bastion host that will be used for configuration tasks using PSSessions to run scripts on remote machines. This was built in an ...
TheRealJoeSchmoe's user avatar
1 vote
1 answer
112 views

Here is a script in which I am trying to pass a variable of type System.Data.DataTable via invoke-command to the remote host: function Test1 { param ( [System.Data.DataTable] $...
Vladimir1211's user avatar
1 vote
1 answer
64 views

Here's my PowerShell 5.1 script to get service status on all machines. I'm giving each server 5 seconds to respond before moving on. However, it still looks like I'm getting the uncaught messages in ...
Rod's user avatar
  • 15.6k
0 votes
0 answers
77 views

Normally I do it into an ssh session from Windows 10 Pro to my android/termux device ( that I am sure could be any linux Distro ) in the next way. ssh to my devive (android/termux) like traditional ...
HillSonMX's user avatar
0 votes
0 answers
66 views

I am trying to create a remote session that allows me to execute windows updates and based on the other threads, creating a virtual session with -RunAasVirtualAccount is the way to go. I have ...
Andy Ooi's user avatar
0 votes
1 answer
154 views

I have a Java application which is started with non admin rights. From my Java application I want to start different PowerShell scripts. The PowerShell scrips have input and output parameter. Inside ...
cProgrammer1992's user avatar
0 votes
0 answers
82 views

Is there a way to run a command in a specific Command Prompt window using its Process ID? $command = "C:\Windows\system32\cmd.exe" $ID = (Start-Process -FilePath $Command -PassThru).Id ...
user18610347's user avatar
1 vote
1 answer
143 views

In a PowerShell script, I have something like this: $Session = New-PSSession -ComputerName "WSEM00G2NZ" -Credential $credObject Invoke-Command -Session $Session -Scriptblock { python ...
user3221037's user avatar
0 votes
1 answer
343 views

I need to create a release pipeline for coping two .dll files and remotely execute a PowerShell script. What I did, Wrote a bash script to download the .dll file and PowerShell script file from ...
Kalana D's user avatar
  • 105
-1 votes
1 answer
258 views

I have some PowerShell scripts, which remotely collect some info form Windows machines via WMI and then return result in JSON format. Now, for these goal i have windows machine, which has all my ...
Иван Гресь's user avatar
1 vote
2 answers
119 views

In this scenario, there two servers. We'll call them ServerA and ServerB. There is also network share: \\share-ip-address\hidden_share$. I am using the following Powershell command to get the most ...
JustMike's user avatar
0 votes
2 answers
926 views

winrm e winrm/config/listener Will list all listener, but displayed in string format. Like this : Listener Address = * Transport = HTTPS Port = 5986 Hostname Enabled = true ...
Alex Lum's user avatar
  • 303
0 votes
0 answers
88 views

Let imagine there is a PowerShell script already there in a remote computer and let that script composed of 8 lines. When I try to run that script from my local computer by using “Invoke-Command”, all ...
Manas Dash's user avatar
1 vote
1 answer
80 views

I have a VM with no password that I want to connect to using PSSessions, but it fails if I try to provide an empty password: > $s = New-PSSession -VMName "vm-240404" cmdlet New-PSSession ...
citelao's user avatar
  • 6,392
0 votes
0 answers
132 views

I have a problem with PowerShell. Main goal is to run an exe (developed by me) on a remote machine. start-process in Invoke the command run related an exe. But its closed immediately by something. It ...
HLTECH's user avatar
  • 11
1 vote
2 answers
227 views

I am trying to run a script on remote using PowerShell. The script starts a service and works perfectly when I execute it using RDP. I try PS C:\Users\me> Invoke-Command -ComputerName '123.123.123....
AndreasInfo's user avatar
  • 1,237
0 votes
1 answer
360 views

$command = { try { $package = Get-Package -Name "*Microsoft Edge*" return [PSCustomObject]@{Version = $package.Version} } catch { return &...
user2978216's user avatar
2 votes
1 answer
65 views

I'm trying to sort my list but it's not sorting as expected. Why is this? Invoke-Command -ComputerName $computers { $rscontent = Get-Item C:\temp\file1.txt | Sort-Object LastWriteTime -Descending ...
Rod's user avatar
  • 15.6k
0 votes
1 answer
348 views

I'm trying to get the system security permission for a specific user on a remote system using SysInternals AccessChk. If I login to a computer as adminstrator, copy SysInternals tools to my ...
Dennis's user avatar
  • 2,128
1 vote
1 answer
40 views

Given: PowerShell 5.1 I'm getting an "Access denied" for some of the the computers in the array. How can make any errors run through the "else" part of condition where it's NOT ...
Rod's user avatar
  • 15.6k
0 votes
1 answer
447 views

How do I: Delete old Certificates windows servers using Power Shell (Azure Classic Release Pipelines) Tried this code and I get: 2024-05-07T02:43:20.4279860Z ##[error]Atleast one remote job failed. ...
mikedopp's user avatar
  • 198
0 votes
0 answers
52 views

I am trying to implement a script, which connects to a remote windows machine via winRM. For that, I am using New-PSSession command. But, there are some machines for which this command takes more than ...
Rashid Raza's user avatar
1 vote
0 answers
23 views

I am new to Powershell. But I put up this script by getting info from multiple SO threads and google search. I am trying to install wildcard certs on multiple servers in one go using below script. $...
Ajay Kumar's user avatar
  • 3,342
1 vote
0 answers
170 views

The script is to be run from a central administration server. I need to check if a directory (BA Client) exists on multiple remote computers. If it exists, I then need to check if it exists on a DFS ...
MACH's user avatar
  • 11
1 vote
2 answers
151 views

I'm running an exe from invoke-command on multiple servers and it works. I get a string array with all the output I expect. $result = invoke-command $servers { & "\path\toexe" arg1 } ...
CoLatrL Damg3's user avatar
2 votes
2 answers
262 views

I am trying to get a Powershell script working where one of my ScriptBlock commands requires an Object as a parameter, rather than a single variable. Example: Invoke-Command -Computername "...
Dan Murray's user avatar
0 votes
0 answers
620 views

I'm tying to get the permissions of all the folders in a path on a remote server as efficiently as I can so I want to make as few calls as I can (avoiding looping through all folders and running a get-...
Hyperbolic_Mess's user avatar
2 votes
1 answer
211 views

I am using the below code to try and pull out a list of last logon times for a group of users contained in a CSV file. I have a test domain at home and the script below works fine. However, when I ...
Andrew Dash's user avatar
0 votes
2 answers
120 views

When defining "private global" variables to be used with functions and scripts in JEA sessions using New-PSSessionConfigurationFile, I noticed that I'm only able to create string variables. ...
Dennis's user avatar
  • 2,128
1 vote
1 answer
186 views

There seems to be some issue with the PowerShell Command Get-InstalledModule. E.g When I log in locally to a Windows server (PowerShell 5.1) and execute command Get-InstalledModule -Name Az it works ...
Ajay Pawar's user avatar
1 vote
1 answer
737 views

Ive made an script to re-add credentials on windows, the script locally works fine, but when i try to execute via Invoke-Command the script just executes itself and does nothing or via Enter-Pssesion ...
AALV8's user avatar
  • 125
1 vote
2 answers
2k views

When re-registering a configured PowerShell session with the same name as before, the WinRM service might (more often than not) need to be restarted. My issue is that this needs to be done remotely in ...
Dennis's user avatar
  • 2,128
0 votes
0 answers
121 views

I've been working with JEA (Jest Enough Administration) in PowerShell recently and would like the JEA sessions to only use a specific non-standard TCP-port. I'm able to configure the WinRM service to ...
Dennis's user avatar
  • 2,128
0 votes
1 answer
181 views

I've been trying to define variables for a PowerShell JEA session in configuration files using VariableDefintions. However, access to the defined variables is denied. All other configurations with ...
Dennis's user avatar
  • 2,128
1 vote
1 answer
361 views

I am trying to build a script that installs an application with encrypted local admin credentials on the pc when the user logged in is not an admin. I am running the below cmdlet: $User = "admin@...
Arpit Kandhari's user avatar
0 votes
0 answers
165 views

Every answer on here is using rasdial. Is there another way to do it? My VPN credentials are already saved so hopefully just the name of the VPN and that's it. Something like, Start-VPN -Name "...
noobie's user avatar
  • 670
2 votes
1 answer
402 views

I'm currently working with a script that utilizes the Invoke-Command over SSH as shown below. While it works well, I'm looking to implement exception handling, specifically for scenarios where the ...
Nanne's user avatar
  • 21
0 votes
0 answers
329 views

I'm having a very odd issue. I have two Windows servers (2022 Datacenter). ServerA and ServerB. As part of an automated deployment process ServerA uses a remote (WinRM) Powershell session into ServerB ...
Ric Hardacre's user avatar
2 votes
1 answer
842 views

I'm trying to run a series of PowerSHell commands on my desktop computer that connect to one of the corporate servers and checks on the status of the services there. I'm doing a Run As on the ...
Ken's user avatar
  • 429
0 votes
1 answer
103 views

I have a very simple script that I would like to run on multiple computers with remote powershell. I'm currently I'm using it on my company's GUI based remote powershell solution for a single computer ...
kbaz's user avatar
  • 1
0 votes
1 answer
47 views

I am creating an inventory script for my team and the end goal is to gather monitor information of multiple computers provided from a list. The output results in an excel sheet with a table. My ...
kbaz's user avatar
  • 1
1 vote
1 answer
237 views

In Windows Powershell (admin): Connect to Remote Windows $session = New-PSSession -ComputerName "xx.xx.xx.xx" Attempting Remote Execution Invoke-Command -Session $session -ScriptBlock { ...
WayneBello's user avatar
0 votes
1 answer
760 views

I'm trying to copy file from one directory on Azure VM to other located outside of VM. I created a script to cover that: [pscredential]$credObject = New-Object System.Management.Automation....
MeR's user avatar
  • 11
1 vote
1 answer
925 views

I'm very new to Powershell and I am trying to create a script whereby I copy a folder from one computer to another computer on the same network, and then run a batch file as an admin on the remote ...
cman32ca's user avatar
2 votes
1 answer
3k views

I have admin for same account on 2 Windows 2016 servers. Server1 has this folder\file: 'E:\Temp\ZEBRA_1.dat' If I open PowerShell (v4 or v5) (as admin) on Server1 and run this line of code everything ...
casewolf's user avatar
  • 324
1 vote
1 answer
1k views

I have a list of 140 servers in a txt file and need to check status of Crowdstrike on each of them and then export to CSV. Would the below be correct? $Computers = Get-Content -Path C:\temp\servers....
Andeng's user avatar
  • 39

1
2 3 4 5
26