For issues relating to Windows PowerShell, version 3.0.

learn more… | top users | synonyms

0
votes
0answers
21 views

Powershell & SQL - Query SQL

I want to print data from my SQL database onto Powershell. Im fairly new to both languages. I'm managing pretty fine with SQL but I'm struggling a bit more with Powershell. I tried this piece of code ...
-2
votes
0answers
16 views

Script to download, segregate and update window server 2008 patches [closed]

I need to patch 40 standalone Servers, due to security reason we are not allowed to update the windows patches directly thorugh internet. MBSA(Microsoft Baseline Security Analyzer) is installed on all ...
1
vote
1answer
34 views

free disk monitoring windows 2012 - powershell

I have started from scratch to be able to learn how to monitor our server (only one). $dates=(get-date).ToString("s").Replace(":","-") $page="page"+$dates+".csv" get-wmiobject win32_pagefileusage | ...
1
vote
0answers
17 views

Manage UAG Server via WinRM

Does anyone know of there is a way to configure a UAG server to work with WinRM? We have a small number of servers and the "Server Manager" application as well as PowerShell are the way we generally ...
0
votes
0answers
156 views

“powershell has stopped working” on PS exit after creating IIS User

On a Windows Server 2012 box, I'm using PS to create a new IIS User (for automated deployments using MSDeploy). The command itself appears to work fine -- the user is created -- but as soon as I exit ...
7
votes
2answers
161 views

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 ...
2
votes
2answers
1k views

Powershell: Single Script to “clean” multiple folders of files older than

I would like to create a maintenance script that would run on each of our servers to clean out common drop/archive directories. Preferably the script would use a reference file for the folder path ...
5
votes
0answers
229 views

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 ...
4
votes
1answer
120 views

What happens when User's UPN Suffix is not Trusted in Active Directory

I have 1275 UPN Suffix in the AD. This is the maximum allowed in Windows Server 2012. $domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain(); $domaindn = ...
0
votes
1answer
80 views

Hyper-V replica - PowerShell - replica merge (detect / invoke)

I need a PowerShell command which can detect replica merge process on the specific VM. And to be sure... There is no way how to invoke replica merge process using a PowerShell command.. Am I right? ...
-1
votes
1answer
489 views

Possible to upgrade PowerShell 2.0 to 3.0 without a reboot?

Is it possible to upgrade powershell without reboot from 2.0 to 3.0 using Windows Server 2008?
1
vote
3answers
733 views

In PowerShell, how can I parse a preformatted output?

Is there existing tooling to take text-based output and pipe it to a dynamic object that can be queried as columns? Specifically, I'm invoking .. query session /server:MYSERVER .. which is ...
4
votes
2answers
83 views

Determine filterable attributes of returned Powershell object

Often when I'm scripting, I will be trying out a command but will want to filter the results. In order to find out what I'm able to filter on I need to know what filterable attributes are going to be ...
0
votes
1answer
203 views

PowerShell Remove-Item can't handle junctions

Windows Server 2012 using PowerShell to create a log file in the temp folder: $LogFile = $env:temp + "\MigrateMyDocs.log" Let's say one's script has already run and you want to delete the log file ...
0
votes
1answer
79 views

Trying to retrieve an error from addding a computer to AD using Powershell

I'm trying to figure out how to retrieve an error from adding a already there computer in Active Directory. Here's the script that I'm using to add my machine in my domain. Add-Computer -DomainName ...
4
votes
1answer
76 views

Powershell script to import CSV to AD

In attempts to automate a few things, I've come across a stumbling block with an import script for AD. A part of the script contains: New-ADUser -Name $Name –GivenName $Person.givenName –Surname ...
1
vote
0answers
306 views

Powershell 3.0 Enter-PSSession fails randomly, reboot solves it. DCOM error in Event Viewer on target machine

Using PowerShell's Enter-PSSession (even locally, against the local computer) fails randomly with the following message. Running Windows 2012 Standard with all updates. The error message takes a while ...
2
votes
2answers
600 views

How do I “catch” a failed command that doesn't work with try…catch?

I'm running the following script that fails for a mailbox that doesn't exist Set-MailboxDatabase rdb16 -AllowFileRestore:$true Mount-Database rdb16 $stats = Get-MailboxStatistics -Database rdb16 ...
1
vote
1answer
224 views

Creating a second domain in a forest using install-addsdomain

I have a domain ludwig.example.com and am trying to create a domain amadeus.example.com using install-addsdomain. I am running this command: install-addsdomain -newdomainname amadeus.example.com ...
0
votes
0answers
244 views

PowerShell doesn't like the -AssignDriveLetter option of the New-Partition cmdlet

I'm trying to create a partition on the USB flash drive using the New-Partition cmdlet. But when I use the -AssignDriveLetter option I get "New-Partition : Invalid Parameter" even though this option ...
1
vote
0answers
278 views

Cannot create partition on disk using PowerShell: “New-Partition : Not enough available capacity”

I'm trying to create two partition on the USB flash drive. The first small 350Mb partition is created fine, but the second throws "New-Partition : Not enough available capacity" even though there is a ...
2
votes
1answer
305 views

Powershell Hyper-V Remote?

Im basically wondering if this is possible, Essentially I have a Powershell 3.0 Script that creates a Hyper-V Server/VHD etc.. it works well but it's obviously defaulting to my local machine. What Im ...
2
votes
3answers
585 views

Adding Unattended.xml Files to Hyper-V Powershell Creation?

As of right now I have a Powershell 3.0 Script Provisioning and Creating Servers. What I want to do is add an Unattended.xml to take it a step further (So I wouldn't have to get on and click ...
3
votes
2answers
541 views

Unattended Install of Windows using Powershell and Hyper-V

Is this possible? I have a script that gets up to the point of Installing Windows Server 2008. However it gets up literally to the "Click Next......etc etc..." and I want to be able to integrate this ...
0
votes
1answer
420 views

Newbie. ForEach, IF, Else

Please educate me. I am trying to test if a file exists on a group of computers' desktop. Some computers are Windows 7 and some are Windows XP. When I run the code, It doesn't test the path on every ...
4
votes
1answer
1k views

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

Hyper-V, Differential Disc, Changing path is resolving junctions - how do stop that?

Gives me a headache. I have a ton of differential discs. In order to move the machiens around - and because (Thank heaven) vm move does NOT copy the sources of differential discs (sadly export does), ...
3
votes
1answer
87 views

How to find the printer driver properties

I have 15 print servers in our environment in different offices. Before upgrading of drivers i would like to display a report with the below information. 32 or 64 bit and Driver last installed or ...
3
votes
1answer
998 views

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 ...
3
votes
1answer
2k views

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?