Questions tagged [powershell-v5.0]

58 questions
1
vote
1 answer

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 way we can do…
karthick
  • 327
  • 1
  • 4
  • 12
1
vote
0 answers

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 file transfer. I am not able to compress the…
Paul
  • 111
  • 3
1
vote
1 answer

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 can remove that file on my server. Why, this can…
1
vote
1 answer

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 the warning. Provider Health: Cannot find the…
Black Dynamite
  • 523
  • 2
  • 5
  • 16
1
vote
1 answer

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 = (Get-Date).AddDays(30) $path = "E:\share\New…
1
vote
1 answer

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\Folder4 C:\Documents\Files\From\Folder5 I want to copy…
user793468
  • 115
  • 5
0
votes
1 answer

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 there is task scheduler, but how do I get to the…
leeand00
  • 4,869
  • 15
  • 69
  • 110
0
votes
0 answers

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 run from the cli: Move-Stuff c:\logs HASTNAME It…
Brad
  • 250
  • 1
  • 11
0
votes
1 answer

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…
0
votes
1 answer

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 that includes the MSOnline module, it does not…
Chyornaya Vdova
  • 94
  • 2
  • 2
  • 7
0
votes
1 answer

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 no A1 Basic size as shown in the image below:…
nam
  • 217
  • 1
  • 11
0
votes
1 answer

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 error: PS script: Get-AzureVMImage | where…
nam
  • 217
  • 1
  • 11
0
votes
2 answers

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 Active Directory. [CmdletBinding()] param( …
Davidw
  • 1,222
  • 3
  • 14
  • 25
0
votes
1 answer

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 proxy, too, so that complicates things. When I…
Luke Puplett
  • 939
  • 3
  • 16
  • 24
0
votes
1 answer

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…
Luke Puplett
  • 939
  • 3
  • 16
  • 24