Questions tagged [powershell-v5.0]
The powershell-v5.0 tag has no usage guidance.
55
questions
0
votes
0
answers
94
views
PowerShell 5.1 I know this UNC path exists and I can get to it from explorer, so why error message
Environment:
PowerShell 5.1
Windows 2016 Standard
Windows 10 Pro
I know this UNC path exists because I can get to it from Window Explorer both in Win 10 and Win 2016, so why am I getting this error?
...
0
votes
0
answers
178
views
Service Account Permissions for Task Scheduler READ
I have a PowerShell script I've written to do a comparison of Scheduled Tasks between two nodes of our application server cluster. It uses this code to query the tasks from a given server...
function ...
0
votes
0
answers
70
views
Creation of a windows service with credentials powershell
I am trying to create a powershell script that can set up and configure a windows service on application server
[string]$serviceAct = "myadminact"
New-Item C:\Temp\pas.txt
Set-Content C:\...
0
votes
1
answer
1k
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
1
answer
274
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
0
answers
70
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
1
answer
101
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
0
answers
147
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 ...
1
vote
1
answer
300
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 ...
1
vote
1
answer
640
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
1
answer
2k
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
1
answer
141
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
1
answer
128
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
2
answers
199
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
1
answer
1k
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
1
answer
71
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
1
answer
62
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
1
answer
1k
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
0
answers
209
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
0
answers
258
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
0
answers
511
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
1
answer
78
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
1
answer
2k
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
1
answer
917
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
1
answer
2k
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
1
answer
403
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
1
answer
171
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
2
answers
1k
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
1
answer
6k
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
2
answers
646
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
1
answer
5k
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
1
answer
236
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
1
answer
504
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
1
answer
369
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
1
answer
245
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 ...
3
votes
3
answers
8k
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
1
answer
6k
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
2
answers
793
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
2
answers
707
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
0
answers
158
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
1
answer
87
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 ...
2
votes
0
answers
483
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
1
answer
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
0
answers
3k
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
1
answer
2k
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
0
answers
855
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
2
answers
4k
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
1
answer
8k
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
2
answers
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
1
answer
2k
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-...