Questions tagged [powershell-v3.0]

For issues relating to Windows PowerShell, version 3.0.

Windows PowerShell Microsoft's task automation platform for Windows, and includes a command-line shell and scripting language. PowerShell was designed especially for system administrators.

Powershell 3.0 comes with Windows 8 and Windows 2012 as a built in package.

74 questions
22
votes
5 answers

Powershell equivalent of Ctrl+R?

In bash I can do Ctrl+R and start typing a command to have it search my history. How do I do that in powershell? Is there a way to bind a key to something like? function GH($str) {get-history | select-string $str} But I would need to re-read the…
red888
  • 4,069
  • 16
  • 58
  • 104
11
votes
1 answer

Set-RDSessionCollectionConfiguration Connection Broker connects to localhost

I am running the following command from a PowerShell console on a Windows 8 machine, trying to configure a Server 2012 R2 RDS Connection Broker: Import-Module RemoteDesktop Set-RDSessionCollectionConfiguration -CollectionName "Example"…
10
votes
3 answers

Enable Certificate Enrollment Policy and Request a Cert using PowerShell

Right now, I'm doing the following to request a cert from a CEP server: Open gpedit.msc Under Computer Configuration > Windows Settings > Security Settings > Public Key Policies, double click "Certificate Services Client - Certificate Enrollment…
9
votes
1 answer

How do I Setup (Initialize, Partition, and Format) a disk using Powershell?

What is a basic example of going through the setup of a new disk (Initializing it, partitioning it, and formatting) it using powershell?
Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444
7
votes
2 answers

What does 'Not Present' mean in the Get-NetAdapter Powershell Cmdlet?

Server 2012, Powershell 3.0. I'm doing some work that requires automating the enabling and disabling of network adapters. Here is an example of what I see when I run Get-NetAdapter: Name InterfaceDescription …
Ryan Ries
  • 55,011
  • 9
  • 138
  • 197
6
votes
2 answers

Invoke-Restmethod breaks script in PS 4.0

I had a Powershell script that used Invoke-RestMethod that was working in powershell 3.0. However, I upgraded to powershell 4.0 to fix a bug in powershell 3. When I did so, my script seems to have stopped working. $username =…
Brett G
  • 2,023
  • 1
  • 27
  • 45
6
votes
2 answers

Why do weekly tasks created via PowerShell using a different user fail with error 0x41306

We have some scripts that create scheduled jobs using PowerShell as part of our application. When testing them recently, I noticed that some of them always failed immediately, and no output is ever produced (they don't even appear in the Get-Job…
6
votes
1 answer

Assign PowerShell script to run at startup using PowerShell on Window Server 2012

I'm trying to write a PowerShell script that will run when a Windows 2012 instance is created on AWS using the configuration tools provided by AWS. My problem is that I want to change the name of the machine once it has started up, restart the…
5
votes
1 answer

How to defrag volume using mountpoint?

I am trying to defrag the volume by optimize-volume cmdlet . I have passed mount point path. But it fails as below. PS C:\Users\Administrator> Optimize-Volume -Path C:\Testvol1\disk Optimize-Volume : No MSFT_Volume objects found with property 'Path'…
Samselvaprabu
  • 1,311
  • 5
  • 13
  • 26
5
votes
1 answer

Get AD Group Member - Different Domains

I've been tasked with exporting the members of a few AD groups to .csv which I've always done in the past using the Get-ADGroupMember command in powershell, specifying the group name, selecting the property I need, and using export-csv. I seem to…
4
votes
2 answers

Can I RDP through mstsc and run a script on that remote desktop?

I'm writing a powershell script which needs to RDP to a few servers and do processes there and then come back. mstsc /v: by itself looks great as it's security/credential prompt is the same as if you manually executed it. However, after…
4
votes
3 answers

Find out if password expired or when it expires for user in a specific OU

Is there any powershell command that outputs the users that have their passwords expired from a specific organizational unit (OU). If so can it be combined in a script with another command that outputs the time when it expires for all the users in…
4
votes
4 answers

Script for getting last reboot timestamp (2008r2)

I have a list of ad-integrated computers and I need a list of them with their last reboot time. I found some comands like Get-WmiObject -ClassName win32_operatingsystem -ComputerName xxx | select csname, lastbootuptime but it's not what I need. I…
4
votes
2 answers

Version v4.0.30319 of the .NET Framework is not installed and it is required to run version 3 of Windows PowerShell

I have a server which we are using for Batch processing. I can login to the server with svc_account and run powershell -f file.ps1 and it runs fine in either version 2 or 3 by the following - powershell -Version 2 -f file.ps1 powershell -f…
4
votes
2 answers

How to filter the Windows Security event log by SID?

I want to filter the event log for a certain user, but I don't think there's an option to search by SAMID. There is a filter by UserId though, according to here. Is the following correct syntax correct to search the user in the screen shot…
Old Geezer
  • 355
  • 7
  • 21
1
2 3 4 5