Questions tagged [powershell-v5.0]
58 questions
4
votes
2 answers
Enable Powershell logging - missing GPO
I want to enable script block logging for powershell. I have installed this new feature with a windows server 2016 VM. Now i want do test this with Windows server 2012 and Windows server 2008. First I installed PowerShell 5.0.
Now I want to aktivate…

spitzbuaamy
- 143
- 5
4
votes
1 answer
Do you Suspend-ClusterNode before or after Move-ClusterGroup?
Which do you do first to avoid service interruption? Or does it not matter?
Is it:
Suspend-ClusterNode -Drain
Get-ClusterNode $env:COMPUTERNAME | Get-ClusterGroup | Move-ClusterGroup
or:
Get-ClusterNode $env:COMPUTERNAME | Get-ClusterGroup |…

Colyn1337
- 2,397
- 2
- 23
- 40
3
votes
3 answers
Powershell - Add-LocalGroupMember - make silent when member exists
I can use Add-LocalGroupMember to add a user to the local group:
Add-LocalGroupMember -Group "Administrators" -Member "foobar"
but it isn't idempotent. If the user already exists then you get this error
Add-LocalGroupMember : foobar is already a…

fiat
- 797
- 11
- 16
3
votes
0 answers
Regulate Implicit Remoting Sessions
Summary:
After running netstat, I noticed that my local device has several established connections to the remote server using port 5985 as seen below:
PS > netstat
Active Connections
Proto Local Address Foreign Address State
…

Alexander Sinno
- 153
- 5
3
votes
1 answer
How to obtain IP Address of Windows 2008 R2 VM on Hyper-V with PowerShell?
I have created an automated build script to build new VMs on Hyper-V 2016. I sometimes need a 2008 R2 VM and the way I obtain the IP Address to connect to my 2012 R2/2016 VMs is to use some powershell like:
get-vm -Name…

Mark Allison
- 2,188
- 7
- 26
- 45
2
votes
1 answer
Powershell, how to compare user input
I'm making a "shortcut" PS1 script to update a domain user's password. I'd like to prompt the user for the new password twice without showing the password on screen. When I use $Text1=Read-Host ; $Text2=Read-Host ; $Text1 -eq $Text2 with the same…

user38537
- 293
- 3
- 15
2
votes
1 answer
Proper method for detecting Apache Tomcat installation via PowerShell?
What's the proper method for detecting whether an arbitrary version of Apache Tomcat is installed on a given Windows server, which we can assume to be Windows Server 2012 R2 or greater, using PowerShell 5 or greater?

HopelessN00b
- 53,795
- 33
- 135
- 209
2
votes
2 answers
Get-ADUser WhenChanged and WhenCreated are empty for some users
I've built a PowerShell 5.1 script to export all the users in the DB and save all the data in to a CSV file. The script allows you to set a date back in time so you can decide since when you'd like your users to be exported.
After some testing a…

David Gatti
- 293
- 1
- 3
- 11
2
votes
0 answers
DSC Environment resource failing to see environment variable it has set
I'm using DSC to provision virtual machines. The VMs are setup to pull a DSC configuration from a pull server. All is well with this. However, I noticed that I am frequently seeing:
Job {8B376B76-EDE7-11E6-80FC-3649808F2EC1} :
From LCM, message…

Peter McEvoy
- 146
- 5
2
votes
2 answers
High CPU usage observed from WMI provider"deploymentprovider" which is a part of ServerManager.DeploymentProvider.dll
I'm using powerShell Desired State Configuration to test/set Windows Features on server machine. What I have is 78 WindowsFeature resources to be checked and installed if necessary. What I observed is high CPU usage while LCM ( Local Configuration…

Juris Krumins
- 73
- 3
2
votes
1 answer
PowerShell object browser
I vaguely remember a tool I used in the dark ages of PS 2.0. The best I can describe it is, you pipe an object to it, and it gives you a GUI that lets you "browse" or "explore" the object. It's sort of like Out-Gridview, but you can expand nested…

jdtrouble
- 23
- 2
2
votes
1 answer
Windows 2016 powershell and NuGet Errors
I am trying to install the Windows 2016 RDWeb HTML5 client on a Windows 2016 RDGW server using these instructions from Microsoft CLICK HERE
I was able to successfully do this on one of our regional server farms last week.
This week, performing the…

NorrComm
- 23
- 2
2
votes
1 answer
How do I compare two folders in powershell 5.1?
I'm having a really difficult time figuring out what PS is trying to tell me. I've created a script that is intended to compare the files in two directories. I want to output any differences in Name, Number of files, or length in either directory.…

Cognitiaclaeves
- 181
- 10
1
vote
1 answer
Are Powershell's New-NetFirewallRule and Set-NetFirewallRule inconsistent?
I noticed that the PowerShell New-NetFirewallRule cmdlet does not behave like I expected. When calling the commandlet repeatedly, it will create multiple entries with the same name.
For example, when running this command twice New-NetFirewallRule…

Jan H
- 153
- 8
1
vote
0 answers
Permanently load environment variable on aws ssm login in windows PowerShell
I am using ssm login for logging into my windows server 2016 data center edition. When I make a RDP connection and run PowerShell from RDP, All the system environment variables are loded correctly however the same fails to load when using a aws ssm…

Shailesh Sutar
- 1,517
- 5
- 23
- 41