Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
86 views

I have an existing script which has worked for some time running on a Windows Server 2016 server, but which gives me an error when run on its relacement 2025 server. What is strange is the error doesn'...
Keith Langmead's user avatar
1 vote
2 answers
97 views

tl;dr If I locally start Invoke-Command to start an EXE file remotely, it fails, if there is no active user session on the remote system. I am facing the challenge of installing an application with ...
LukasHT's user avatar
  • 345
1 vote
1 answer
128 views

I want to find all Package.json files on a remote system using PowerShell. In order to optimize this, I found a C# class on the internet adjusted it and now would like to use it. This code runs really ...
AhYep's user avatar
  • 11
0 votes
1 answer
108 views

OK, I'm piggybacking off my previous question Powershell script to get IIS app pool recycling time from servers and wondering what I'm doing wrong I have a list of IIS app pools (apppools.txt) and a ...
dbutts's user avatar
  • 43
1 vote
0 answers
32 views

I have a Powershell script 'hello-world.ps1', which is overly simple, it takes no arguments and simply writes some text to the console: Write-Host "Hello world" With the command prompt, ...
SimonAx's user avatar
  • 1,388
1 vote
0 answers
1k views

I'm attempting to run sfc.exe /scannow on a remote computer using PowerShell's Start-Process, but I'm unable to confirm whether the process starts on the remote machine. When I check for any sfc ...
user2978216's user avatar
0 votes
1 answer
351 views

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

So I tried calling the following code with and without credentials. $username = "user" $password = "password" $cred = new-object -argumentlist $username, $password #Invoke-Command ...
Anne Marie's user avatar
0 votes
1 answer
140 views

I have a working PS Script to run in an Azure Runbook to map a drive to a remote server to then copy very specific files to Azure blob storage. NOTE: The entire script works 100% in VSCode > ...
sllucas's user avatar
1 vote
0 answers
165 views

I've got a problem with running Invoke-Command on remote Computer with WinRM up and running. I've configured and run WinRM, but Invoke-Command with task of Silent Install is not successfully run until ...
anton123's user avatar
-1 votes
1 answer
447 views

$upgradeInvoke = Invoke-Command -Session $session -ScriptBlock { try { Shutdown.exe /r /f /t 1200 /d p:4:2 /c "Triggerd Reboot Timer for 20 minitus" $...
SpicerLabs's user avatar
0 votes
0 answers
596 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
1 vote
1 answer
2k views

I open PowerShell as admin and use the following line of code to run an offline file for windows updates. It works fine Start-Process 'wusa.exe' -ArgumentList 'C:\Temp\windows10.0-kb5032189-...
Tevin Mosley's user avatar
2 votes
1 answer
397 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
83 views

I've been tasked with updating some certificates on some remote servers. We have a TON of servers and not all of them have these certs installed. To make a short story long.... There are 2 different ...
Nate's user avatar
  • 75
0 votes
1 answer
362 views

I have been racking my brain over this and scouring the internet for an answer, but I can't seem to find anything for my specific situation. I have created a set of Functions that help me add/remove ...
FlyingSubieSTi's user avatar
0 votes
1 answer
849 views

I am trying to figure out a way to use a global variable in a Invoke-Command without success. There are some posts which I tried but they do not work in this use-case. So what I have is a script like ...
k_k's user avatar
  • 83
0 votes
1 answer
426 views

I need to be able to launch command by shell console or powershell having the administrator window in powershell 7. I have launched several commands with Start-Process but none of them returned the ...
alex's user avatar
  • 1
0 votes
1 answer
76 views

I'm basically writing a program that takes an input of a current folder path from a user and a new folder path that they want to rename it as. Then the program remotes into a file server that the ...
Luke Willard's user avatar
0 votes
1 answer
148 views

I try to get Windows audit policies on several Windows servers with an Invoke-Command cmdlet. It works fine for all servers, except one where I get only the first object property (the added ...
scrouet's user avatar
0 votes
1 answer
62 views

I am trying to get a shadow storage information from remote computers. I could get the information and store in a variable as table. But every time the log file is being overwrite by the new ...
Brazs's user avatar
  • 77
3 votes
1 answer
233 views

Having a few issues with this PowerShell code: $vmslist = Import-Csv -Path .\vmsList.csv -Delimiter ',' | ForEach-Object { $_.Servers $vms = [string]$env:COMPUTERNAME $currentVms = $_....
dcwilli5's user avatar
0 votes
1 answer
297 views

I try to run an oracle bat script (opatch.bat) remotely to gather info on patchlevels on oracle agent installations. The command to run is invoke-command -ComputerName <remote_computer> -...
Mats Nordqvist's user avatar
0 votes
2 answers
635 views

The goal of the script is to invite a user to a specific project in Azure DevOps via REST. Invoke Request was used to add a user with the appropriate permissions. I'm able to successfully retrieve the ...
Shez Bhagwandin's user avatar
1 vote
1 answer
5k views

Script_A.ps1 on Server A: Invoke-Command -ComputerName Server B -ScriptBlock{ Set-Location "C:\Path" .\Script_B.ps1 } The Script "Script_B.ps1": Set-Location "C:\...
cosmo_'s user avatar
  • 11

1
2 3 4 5
12