Questions tagged [powershell-remoting]

The ability to create a remote connection, in an other way than using WMI, is the most important difference between PowerShell v 1.0 and 2.0.

Host applications can use a PowerShell object to run commands that use WS-Management-based Windows PowerShell remoting to create a temporary or persistent connection to the remote computer. This includes establishing an interactive session with a single remote computer.

1238 questions
2
votes
2 answers

passing parameter to the powershell script file from C# environment

i understand that the subject line looks too mundane and there are posts addressing many such questions. I did not find what i was exactly looking for and hence this post. I am invoking a powershell file from machine A to be executed on a remote…
2
votes
2 answers

C# Powershell Pipeline foreach-object

I have this PowerShell command to add members to a Distributon Group in Exchange Online. This works correctly in PS. But I need to do this from a C# app. $arr | foreach-object{Add-DistributionGroupMember -Identity 'Test' -Member $_} I need to pass…
preambleMe
  • 33
  • 1
  • 4
2
votes
1 answer

Positional Parameter issue

I have a script that ends up creating a variable for each user in AD ($variableResult), iterating through each user. I have tested everything outputting to a log file - all fine. The last stage is to get it to write changes ($variableResult) to AD…
Bash
  • 67
  • 4
2
votes
1 answer

How to compare two CSV file using PowerShell

I have a csv file call Full-List.csv that have columns like this Old_URL Number I have another csv file Sub-List.csv that have columns like this Old_URL New_URL Title Owner I'm just wondering how can I compare the two csv file using…
2
votes
1 answer

Enhancement of PowerShell script to query ports on GPO within AsBuiltReport Framework

I got the current script (from this answer) which I want to improve. The script should retrieve the desired ports if they are enabled and allowed within the inbound direction. Filters for Action/Enabled/Direction work perfectly but I still need that…
2
votes
1 answer

How to speed up the process in PowerShell

I've a simple script that generate orphan OneDrive report. It's working but it's very slow so I'm just wondering how could I modify my script to speed up the process. Any help or suggestion would be really appreciated. Basically this is what I'm…
2
votes
1 answer

Passing scriptblock as an argument to Invoke-Command scriptblock in powershell

I have a powershell script in which I have been trying to pass scriptblock(i.e $sb) as an argument to another scriptblock. However, I keep getting error that: Cannot convert the "{get-member}" value of type "System.String" to type…
2
votes
2 answers

MSIEXEC what is the difference between /q and /quiet in install params

what is the difference between /q and /quiet in the case of install params? example what does the following statement mean. InstallParams = "/q /norestart"
2
votes
1 answer

Get-Process -computername pipeline input works only with the first name

Get-Process accepts -computername parameter by pipeline (ByPropertyName). The file I import looks like: computername sql01 sql02 sql03 When I pipe it, I'll get the processes only from the first computer in the list (sql01)? $a = Import-Csv…
Purclot
  • 483
  • 7
  • 22
2
votes
1 answer

Trying to run Get-WindowsUpdate on a remote computer but get: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

I've got a powershell script to remote into other computers to get and install windows updates. I'm logged into the admin account on my local machine. The script starts a powershell remote session into another computer which works fine. Then once in…
2
votes
1 answer

Capturing output/error in PowerShell of process running as other user

This is a variation of a question that has been asked and answered before. The variation lies in using UserName and Password to set up the System.Diagnostics.ProcessStartInfo object. In this case, we're not able to read the output and error streams…
malthe
  • 1,237
  • 13
  • 25
2
votes
1 answer

File operation failed with New-PSSession

I'm loading a json file that contains a list of computer names and each of them contains a list of files I need to operate on. For this example, I'm just displaying the file sizes. But I'm getting file not found errors. I think it's because…
Ray Cheng
  • 12,230
  • 14
  • 74
  • 137
2
votes
0 answers

Powershell on Linux Copy-Item to remote server fails with files over 275K

I am running Powershell 7.1.4 in a Debian Buster Docker container and am trying to copy a file from the container to a remote Windows server. I can do this just fine for any file under 275K but cannot do this for any file 280K or larger. I can copy…
Craig Souder
  • 68
  • 1
  • 4
2
votes
0 answers

How do I run bash commands under windows server 2019 with powershell remoting?

I have build a powershell script to run commands remotely. Nothing really to it, just open a session, invoke-command, do some logging and exit. That script is called remoteExecute.ps1 It is working fine as intended when I run it the outputs are what…
2
votes
1 answer

PowerShell Remoting Not installing MSI

Good Afternoon, I'm having some troubles getting the Microsoft Edge .msi to install onto a windows server 2012R2 through PowerShell Remoting. The code works on my local machine but when I try to parse it through with remoting it just hangs there and…
Fitzgery
  • 558
  • 5
  • 14