Questions tagged [powershell-v4.0]
67 questions
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…

vivek singh
- 11
- 1
0
votes
1 answer
WIn 2012/R2 How to find Powershell ISE 32 bit
First, I don't see any matches for "ISE" when I click the start button and type "ISE". I am able to run C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe and open ISE it seems to be the 64-bit, because I ran the following:…

NealWalters
- 1,333
- 8
- 19
- 39
0
votes
1 answer
How to get the size of the file using get-itemproperty in PowerShell?
I have a file having data around 5GB. I tried to get size of the file using get-content $path2 | Measure-Object method. But its taking more time as Get-Content cmdlet is present.
Is there method to get the size of this kind of file very quickly. I…

Dinesh
- 1
0
votes
0 answers
Illegal Characters in Path While Installing Module
In Powershell 4, I'm attempting to install the GoogleCloud module.
I use the command:
Install-Module GoogleCloud
It fails with:
PackageManagement\Install-Package : Illegal characters in path.
At C:\Program…
0
votes
2 answers
How to filter the content of Powershell script output?
I need to capture the result of MSSQL Queries in Ansible output however, there are no supported Ansible modules which help me to achieve this. As a workaround, i have written a powershell script which runs the SQL query and returns the output in a…

Ankit Vashistha
- 101
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…

asur
- 101
- 2
0
votes
1 answer
Adding the Exchange 2013 PS SnapIn using Invoke-Command not working
I've been building a Powershell Module for our helpdesk team, and ran into an issue at some point: They don't seem to have the proper access rights to add the Exchange 2013 Powershell SnapIn, and I don't know where to look for this specific…
0
votes
1 answer
Get-AD GroupMember from a list of users in a csv
I have a list of users in a csv file, they are the displaynames. I wrote the following but all I get back is the displayname not the memberships what is needed?
$csv = Import-CSV "c:\users.csv"
foreach($user in $csv){
$Displayname =…

Jedi Administrator
- 11
- 2
- 5
0
votes
1 answer
PowerShell Sciprt to Logon a User to Win 2008 R2 Server?
I am a PowerShell Noob so please forgive. I have a Windows ID on a Win 2008 R2 server that runs a dedicated Outlook VBA application. I have tried suggestions on how to get this userid to autologon should the server be restarted, but they have been…
0
votes
0 answers
Odd behavior using WinRM via powershell, works sometimes and other times does not
Been setting up Powershell Remoting for all of our client machines (Pushed out GPO last week) and I can Test-WSMan on pretty much all of them and I get a nice expected response.
Now on one of our servers (our SCCM 2012 with all the latest updates)…

TofuBug
- 101
- 3
0
votes
1 answer
can't open new powershell session from one server to another
I am trying to open a powershell session from one server to another. I can open sessions to servert1/2 which have the same configuration as far as I can tell. trustedhosts are the same, same user/pw being used. Yet when trying to open a session to…

C.Rosenstadt
- 1
- 2
0
votes
1 answer
Powershell: a simple script to take a list of commands and append the same cmdlet every time
I have a list of commands I run in a script like this
Some-Cmdlet -someswitch | Outfile -filepath .\somefile.txt -append
Another-Cmdlet -someswitch | Out-File -filepath .\somefile.txt -append
Hello-Cmdlet -someswitch | Out-File -filepath…

Daniel
- 1,614
- 9
- 29
- 47
0
votes
1 answer
Powershell scripts to determine remote CPU Temperature
Is there a Powershell Script to remotely check the CPU temperature of a Domain PC.
Thanks

Bart
- 9
- 3
0
votes
1 answer
PowerCLI transfers a file but the copied file size is way too small. What is wrong?
I am using PowerCLI version 6 on a Windows server with 20 GB of free space. I am trying to use copy-datastoreitem with PowerCLI. It seems to work to transfer a .vmdk file from an ESXi datastore to the Windows server that has PowerCLI. There are…

Kiran
- 67
- 4
- 10
0
votes
1 answer
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 scan the log of the DC that runs the role PDC…

Eli Bukin
- 1
- 1