Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

0 votes
0 answers
34 views

PowerShell Start-Process in Invoke Command doesn't work correctly [duplicate]

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
  • 13
1 vote
2 answers
54 views

Run script as admin on remote using PowerShell

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,215
0 votes
1 answer
31 views

Efficiently Retrieving Microsoft Edge Versions from Multiple Remote Machines Using PowerShell Jobs

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

What am I not understanding about sorting this list [closed]

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.2k
0 votes
1 answer
86 views

Why can't I run accesschk using a PowerShell remote session to check system permissions?

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
  • 1,569
1 vote
1 answer
34 views

How can I make any errors thrown go thru the else part of my condition?

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.2k
0 votes
0 answers
22 views

While connecting to a remote machine with New-PSSession command -OpenTimeout option not working

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
20 views

WildCard Certificate appears to be installed but not installed in reality

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,160
1 vote
0 answers
61 views

How do I check whether directory exists on remote computer/DFS share, and create it if not?

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
65 views

Powershell sorting data in Invoke-Command results

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
73 views

How to pass an Object in a ScriptBlock instead of a single variable?

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
43 views

Remote PS Command with Output

Good afternoon all. Let me start off by saying I appreciate all the assistance whenever I ask a question, and I promise I am trying to brush up on my PS, but it's a lot slower than I thought it would ...
Charles Waters's user avatar
0 votes
0 answers
165 views

get-acl access property is just System.Security.AccessControl.FileSystemAccessRule when run inside invoke-command

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
60 views

Variable not defined when trying to list a group of AD user from a CSV using Get-ADUser -Filter {displayName

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
79 views

How do I define hash tables with protected values using the VariableDefinitions section in PowerShell JEA session configuration files?

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
  • 1,569

15 30 50 per page
1
2 3 4 5
76