Questions tagged [powershell-v5.0]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Powercli create local user and assign permission At VC level

I need a powercli script to automate some task in VC , I have found below script but here I can assign AD group permission to folder level. but I want to assign permission at VC level. is there any ...
1
vote
1answer
87 views

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

WSMAN error using Register-PSSessionConfiguration

Windows Server 2016 v1607 Build 14393.3930 PowerShell 5.1.14393.3866 This is a Google Cloud VM I am teaching students some basic PS Remoting. Set up a simple DNSOps group and use ps-remoting to show ...
0
votes
1answer
54 views

Automating the downloading of data from a website

I am writing a powershell script to extract data from OpenStreetMap automatically for a country. My whole script is written, but not quite functional. My script below: $ie = New-Object -ComObject ...
1
vote
0answers
62 views

How do I send about a million files asynchronously with Start-BitsTransfer in PowerShell 5.1?

I am attempting to transfer about a million files of various sizes from one server to another, and due to various size, network and time constraints, I'm attempting to use BITS in PowerShell to do the ...
0
votes
0answers
34 views

Why Get-SmbOpenFile returns unexpected results?

Get-SmbOpenFile really behaves unexpectedly. Even the .vhdxfile is mounted and can be seen from diskmgmt.msc but when I issue the command Get-SmbOpenFile, time to time the mounted file doesn't shows ...
1
vote
1answer
140 views

Why Get-SmbOpenFile losses the lock when file still opened at remote

I am using Get-SmbOpenFile, But surprisingly, it looses its connection and I can see that there is no lock even after couple of seconds later on the file any more, even it is still opened. I safely ...
0
votes
1answer
250 views

Win Server 2016 - Event ID = 300, X509 store location WindowsPowerShell is not valid

I have a Windows Server 2016 (Build 14393) that I'm running NPrinting on (possibly not relevant). I performed an update on Friday night, and I am seeing EventID=300 errors. Below is the full text of ...
0
votes
1answer
613 views

Executing Remote commands on target machine via WinRM in workgroup environment

I'm looking forward to run special commands on a target machine in my local network (workgroup, no domain join). The machines have been previously configured with Enable-PSremoting etc.. to tolerate ...
1
vote
1answer
36 views

I want to delete 30 days old folder + sub folder by using Powershell were folder save in date wise

I want to delete 30 days old folder & all sub folder which name start "dba_20200312-0500311 - 123" # $curDateTime = Get-Date -Format yyyyMMdd-HHmmss, folder save in this date format $mydays = (...
2
votes
1answer
111 views

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

delete unnecessary settings from GPO

I want to delete some unnecessary settings from one GPO. I use windows server 2016, and i have unnecessary registry settings which i don't want to appear in my GPO. It is possible to perform this ...
2
votes
1answer
773 views

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

Coping folders from location listed in a text file to a new location

I have a text file "FromTo.txt" which contains folder paths, for e.g. C:\Documents\Files\From\Folder1 C:\Documents\Files\From\Folder2 C:\Documents\Files\From\Folder3 C:\Documents\Files\From\...
0
votes
1answer
51 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 ...
1
vote
1answer
681 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 ...
1
vote
0answers
130 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
138 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
348 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
64 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 ...
1
vote
1answer
1k 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
640 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 ; $...
2
votes
1answer
1k 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
305 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
106 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
970 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
5k 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
449 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
4k 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
199 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
419 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
334 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
219 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 ...
2
votes
3answers
6k 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
5k 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
611 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
580 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
156 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
83 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
391 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
2k 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
813 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
2answers
3k 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
7k 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
1k 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
1k 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
167 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 ...