Questions tagged [powershell-v5.0]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
43 views

Stopping powershell background jobs at a scheduled time?

I started a few powershell jobs and I want to stop them at a scheduled time. I know the command to stop them is Stop-Job -Name $someName but I don't know how I can schedule this. I mean I realize ...
0
votes
0answers
101 views

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 ...
0
votes
0answers
34 views

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 ...
0
votes
0answers
58 views

PowerShell function parameter becomes null inside try block

I'm putting together a powershell zip in transit script that would be called via a function, but it keeps saying the path is null after it creates the zip file. After running the script in ISE I then ...
1
vote
0answers
102 views

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 ...
1
vote
1answer
46 views

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 ...
0
votes
0answers
17 views

Windows Server 2016 standard vmware moved network, powershell started having issues

We have a Windows server 2016 standard on vmware where we were running a fairly complex set of powershell windows. One window starts, reads some files and gathers information and then starts a second ...
0
votes
0answers
8 views

Setup aliases and functions in powershell without enabling scripts on the system?

I have a couple small functions which I would like to have available for my profile when I use PowerShell ( PSVersion 5.1 ). But I do not want to enable running scripts on the system. Hence is there ...
1
vote
1answer
223 views

Run Direct Access cmdlet remotely

I have a DirectAccess server up and running, has been for years and all is fine. But a nagging problem or issue that I have just never figured out is that I am trying to run the cmdlet Get-...
2
votes
1answer
231 views

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 ; $...
1
vote
1answer
641 views

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 ...
1
vote
1answer
185 views

Powershell Array for Path

We are trying to break the following Path from the text file, the path is dynamic in length, i.e, it can be ABC\DSD\AAR\ARE or ABC\DSD. So we need a solution to break down the path as per the ...
0
votes
1answer
89 views

PS-Remote shell access to a user

I am currently adding Full control to an user manually. Please see below screen shot. But this needs to be done via a PS script.I followed https://blogs.technet.microsoft.com/heyscriptingguy/2010/11/...
-1
votes
2answers
414 views

Powershell script Needd to set the state of Allow Remote Shell Access [closed]

I am looking for a script which will set the value to "Enable/Not Configured/Disable" of Allow Remote Shell Access in Gpedit via Powershell script. Below value state value should get changed to ...
1
vote
1answer
2k views

How to properly run Powershell scripts containing BITS operations from Task Scheduler?

I am trying to perform an automatic backup of some files and folders based on a configuration. This is done using Powershell 5 which in turn relies on Background Intelligent Transfer Service (BITS). E....
1
vote
2answers
104 views

How to access result and volume of WindowsServerBackup via PowerShell?

I want to check automatically the latest WindowsServerBackup result via PowerShell on Windows Server 2012/2012 R2. It's not only "success" or "failure" but "backed-up volume" and "error message", too....
2
votes
1answer
2k views

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 ...
0
votes
1answer
151 views

Loaded PS Modules not included when Powershell is called via PHP

Good day everyone. My question is about calling a powershell script using PHP. So, if I am calling a PS1 script using ActiveDirectory module, there are no issues. However, if I am calling PS1 scripts ...
1
vote
1answer
145 views

powershell 5.1 on windows server 2016 not working

I'm following exercise 1 of this Microsoft official Azure lab under the heading Deploying Azure SQL Database by using the Azure PowerShell. The VM machine in the lab is Windows Server 2016. When I run ...
0
votes
1answer
213 views

Azure VM size A1 Basic not available

I'm following an official Microsoft tutorial on Azure with free trial where they ask us to create a VM of size A1 Basic on a region closer to you. But when I select any of the following regions, I see ...
0
votes
1answer
194 views

Using Azure Powershell - How to get image name for the newest image of Windows Server Data Center

I created a VM using Windows Server 2012 R2. Now trying to acquire the image name for the newest image of Windows Server 2012 R2 Datacenter using following `PS 5.0`` script. But it gives the following ...
1
vote
3answers
4k views

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 ...
1
vote
1answer
2k views

How to tell what Operating System is running in HyperV VM with Powershell

So here's the environment. Host: Windows 10 Guests: Server 2012 and Server 2016 Purpose: Development system to automate pushing out builds to servers for testing during development. I've got a ...
0
votes
2answers
378 views

Powershell script to create new users and move them into OU based on user description fails to move users

This script will create the new users, but it won't then move them based on the user's description? Edit, it appears that Powershell is showing the description field as blank, but it's populated in ...
1
vote
2answers
276 views

Pushing a hosted Registry File to Multiple Servers

I have bunch of Servers I need to push this patch through. Normally I would load up a WSUS or equivalent. However I would like to get this working in a DSC enviroment. So I am testing scripts to put ...
3
votes
0answers
145 views

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 ...
0
votes
1answer
76 views

How to get PSGet up and running from scratch

On a new build machine with PowerShell 5.0, how do I configure PSGet so it actually just works? I think it needs me to tell it what package provider I want and then what repository? And I'm behind a ...
1
vote
0answers
328 views

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-...
1
vote
1answer
1k views

Load a nuget package installed by Install-Package in Powershell v5.0+

In Powershell v5.1... If I install a .NET NuGet package (example: redmine-api) using this command: Install-Package redmine-api How do I then create a new object from that package for use in ...
1
vote
0answers
1k views

Go to network share\folder with Powershell

I'm trying to access a network share in PowerShell 5.1 with elevated permissions executing the following command: gi "\\192.168.1.1\data" I'm recieving the following error: gi : Cannot find path '\\...
3
votes
1answer
1k views

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 ...
1
vote
0answers
752 views

How can I scrape the Meraki client page for devices and their owners?

I am trying to automate a weekly process where I download a CSV copy from the Client page on the Meraki website. Before I lose you I am aware there is an API and it works very well. However there in ...
1
vote
1answer
2k views

Clear-RecycleBin on remote computer fails

If I RDP to my Windows 2016 server (called LAUREL) and run this powershell, it works fine: Clear-RecycleBin -DriveLetter C -force However if I run from my Windows 10 workstation logged on as a ...
-1
votes
1answer
5k views

How to change IP Address of remote VM with Powershell?

I am creating an auto-build process in Powershell and need to build a VM with a static IP address. The VM gets built by the script and is assigned a DHCP IP Address. I can query the Hyper-V host to ...
4
votes
2answers
855 views

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 ...
1
vote
1answer
939 views

Remote Invoke-Command Powershell Stop-WebAppPool No Longer Working After Powershell 5 Upgrade

We have a PowerShell script that takes down a remote app pool via the following commands: $appPoolName = "myAppPool" $server = "myserver.domain.com" $stopAppPoolScript = {param($appPoolname); Import-...
0
votes
1answer
34 views

New-ModuleManifest does not prompt for standard keys

On Windows 10, using PowerShell 5.0.10586.494 the New-ModuleManifest cmdlet just returns after prompting for the file path. This goes against the documentation. How to Write a Module Manifest https:/...
0
votes
1answer
143 views

Difference between two powershell scripts

I received a script that is supposed to scan the event logs of 4 DCs, searching the event ID 4740 (user lockout). This is script number 1. Now I thought to myself, "Why scan all the DCs when I can ...
4
votes
1answer
2k views

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-...
2
votes
2answers
222 views

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 ...
1
vote
1answer
450 views

WMF 5.0 (April Preview) DSC Pull Server Installation fails

I am trying to install The DSC-Service Windows Feature on a Windows 2012 R2 machine with WMF 5.0 already installed. The installation fails with the following errors: Install-WindowsFeature DSC-...