Questions tagged [powershell-v5.0]
53 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,357
- 2
- 20
- 37
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
- 727
- 11
- 15
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,038
- 6
- 26
- 44
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
- 273
- 3
- 13
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,045
- 31
- 131
- 206
2
votes
1 answer
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
- 233
- 1
- 3
- 10
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
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
- 7
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,377
- 4
- 21
- 39
1
vote
0 answers
MD5 hash comparison over SMB SLOW
I'm scripting a full backup solution in powershell on Windows server 2016 for Hyper-V VM's and have run into the issue that calculating the MD5 hash over the network on a mounted network drive across a WAN is about half the speed of just doing the…
Brad
- 250
- 1
- 11
1
vote
1 answer
DSC not pulling config
my DSC node is not pulling the DSC config from my SMB DSC server. Get-DSCConfigurationStatus says the pull was successfull but Get-DSCConfiguration remains the same(old config).
Im testing it with a HelloWorld config where a file is created on the C…
seyo -IV
- 43
- 6