An interactive shell, scripting and programming language, and surrounding environment from Microsoft. Commonly used by system administrators managing Microsoft software (including Windows, Exchange, SharePoint, and cloud services Azure and Office 365), PowerShell is included by default with Windows, ...

learn more… | top users | synonyms (1)

0
votes
0answers
143 views

azure powershell run customscriptextension - powershell exit code 1 - works from Azure Portal

I’ve been working on automation for Azure VM deployment with the Microsoft CustomScriptExtension for VMs. http ...
0
votes
1answer
169 views

Powershell script to display all groups and the users they contain [duplicate]

I'm currently trying to write a script that displays each group and user in the domain. Import-Module ActiveDirectory $Groups = (Get-AdGroup -filter * | Where {$_.name -like "**"} | select ...
0
votes
2answers
87 views

Powershell script to display all groups and their users

I'm currently trying to write a script that displays each group and user in the domain. Import-Module ActiveDirectory $Groups = (Get-AdGroup -filter * | Where {$_.name -like "**"} | select ...
2
votes
2answers
555 views

Logoff Script on Remote Desktop Services

I have a Remote Desktop services running on Server 2012 R2. My timeout settings have been set to end a session 60 minute after disconnection. This is good for all the users except one: That user's ...
2
votes
1answer
3k views

Sending mail notifications from Windows Server 2003 Powershell 2.0 to Office 365

My script is meant to suck up errors in scheduled tasks that don't complete correctly and sends them to my email address via Office365: $reportHTML = Get-Content C:\windows\tasks\SchedLgU.Txt | ...
0
votes
1answer
96 views

connect to ipsec vpn on sonicwall device from a powershell script: Guidance?

Win2012-R2 We have a vpn network device that can surface ipsec and pptp vpn endpoints. I can see docs for various vpn commands in powershell, e.g. ...
1
vote
0answers
136 views

Stop automatic reboot with gpedit shutdown script in Windows 2k8

I am search for a way to validate and maybe stop an automatic reboot under windows. E.g. automatic reboot is initialized by windows update. When adding a shutdown script with gpedit this script gets ...
1
vote
1answer
109 views

Powershell Command to restart/reload a script within Else statement

I'm creating a powershell script to repair or re-install a client remotely based upon the users input (basic script example below): $env:COMPUTERNAME = Read-Host 'Please enter hostname' ...
1
vote
2answers
1k views

Remote PS session fails on non-domain server

I'm trying to connect to a non-domain joined remote Win2008R2 server using PS from a Win8 host (same subnet, it's a local VM). Tried everything I could find, nothing works. SERVER: PS ...
1
vote
1answer
658 views

PathTooLongException error when using Get-ChildItem

I'm trying to generate a list of all known file on a file share with Attributes "Archive + Offline". But I keep running into PathTooLongException errors. So far I've only found that Robocopy can work ...
0
votes
0answers
74 views

Invoke-GPUpdate fails even with firewall disabled

PS C:\Users\Administrator> Invoke-GPUpdate -Computer rim-23 Invoke-GPUpdate : Computer "rim-23" is not responding. The target computer is either turned off or Remote Scheduled Tasks Management ...
1
vote
0answers
524 views

Move-ADObject : The operation could not be performed because the object's parent is either uninstantiated or deleted

PS C:\Users\Administrator> Get-ADComputer NAME | Move-ADObject -TargetPath "OU=SERVERS,OU=COUNTY, OU=STATE,OU=REGION,OU=COUNTRY,DC=subdomain,DC=mydomain,DC=com" However, I am getting this: ...
2
votes
1answer
38 views

MoveDataPowerShellHost.exe missing from sbserver

We are getting a lot of errors in our eventlog that indicates our sbsmonitoring DB is too big. I've had this once before, so I found a method to recreate that DB. In order to do that, I need a ...
2
votes
2answers
601 views

Can't access Azure VM via RDP any more

I set up an Windows Server VM on Azure last year and after having not logged in for a couple of months I tried to log in recently and strangely it told me my password was incorrect. I proceeded to ...
4
votes
1answer
203 views

Unable to rename computer with powershell

$script = { Rename-Computer -ComputerName "ADMINIS-ID1PS7V" -NewName "SERVER1" } $computerName = "ADMINIS-ID1PS7V" $username = "Administrator" $pw = "123!@#qaZ" # Create Credentials $securepw = ...
0
votes
1answer
80 views

Moving computer with powershell in MDT

I have MDT 2013 deploying several images. With Powershell I would like to move them to the correct OU as well. Is that possible? I was trying with the following but it does not seem to work: ...
2
votes
1answer
80 views

Powershell: Secure Strings with Sysprep

I have two Powershell scripts I'm building for a Windows 7 image. Prior to the image I run PRE-IMAGE.ps1, and it has a line like this in it: $JoinDomainPassword = Read-Host -Prompt "Please enter the ...
0
votes
0answers
15 views

EC2 UserData analog for Windows on ESXI

Are there any analog of the ec2 user data for the Windows on ESXI? I want to solve following task: when new instance starts at the first time on ESXI hypervisor it need to be bootstraped with some ...
0
votes
5answers
247 views

Can you use powershell to “spin up” new VM instances

Learning powershell and working on creating VMs with Hyper-v. I was wondering is there a way or an ideal way to go about installing/setting up guest operating systems as well with it? So far the only ...
1
vote
3answers
409 views

Is it possible to migrate Azure VM image from one Subscription to another Subscription?

I recently captured one azure vm image in one storage account, and planning to migrate this image to another storage account under a different subscription. I used PowerShell Script to run this task, ...
2
votes
2answers
67 views

Bizarre behavior of e-mailed reports (text files) via Task Scheduler

I’m still pretty new to powershell and practical implementations of it… but I created a script to monitor disk health and have some very bizarre results on 2012 R2. Wondering if anyone has seen the ...
3
votes
1answer
85 views

How to get a list of RUs, SPs and other updates installed for Exchange from a command line or PowerShell?

Is there a way to get a list of updates, rollups, service packs installed for the MS Exchange Server from a command line, PowerShell or Exchange Management Shell? I already tried Get-Hotfix, ...
1
vote
1answer
189 views

IIS backup on Multiple servers from Powershell

Can someone help me with backup of IIS on multiple servers from powershell script remotely. I can take backup of IIS from powershell command. backup-webconfiguration -name IIS_backup. Also i have a ...
1
vote
1answer
122 views

How to run mysql prompt in windows powershell ISE?

I want to use PowerShell ISE tab to be able to connect mysql client and tun sql statements, however as soon as I connect to client using following command - >mysql.exe ...
0
votes
1answer
96 views

How to start multiple Azure VM at the same time?

I'm trying to use Powershell scripts to start multiple VMs at the same time. I only know how to start one single VM or all VMs at the same time, but in my case, I only want to make change to selected ...
3
votes
1answer
125 views

Windows Desired State Configuration / DSC: Is there a simple, “flat” way to use them?

The articles all discuss staging, packaging and a bunch of infrastructure aspects. Is it possible to just run the scripts, either locally, or (preferable!) against a remote server? E.g. ...
0
votes
1answer
76 views

Editing XML files from powershell

I have this XML file below which I need to edit. <?xml version="1.0"?> <rdwastr:strings xmlns:rdwastr="urn:microsoft.com:rdwastrings"> <string id="PageTitle">RD Web ...
0
votes
0answers
121 views

PowerCLI Move-VM Returns failure but vm still moves

I have a script that is moving VM's from one datastore to another. I have other logic to protect the Storage backend and fabric from over subscription and to wait to submit new requests at specific ...
0
votes
1answer
104 views

Is it possible to execute Azure automation runbook on Visual Studio?

I am considering about two cases. One is edit runbooks on Visual Studio, then execute them to perform Automation task directly. Another one is that edit runbooks on Visual Studio, then I use ...
1
vote
1answer
149 views

Can I execute Azure Automation Runbook on PowerShell?

Actually I want to run these runbooks by myself, not relying on Automation Part. In this case, I can choose when to deploy them, and also it is flexible for me to choose variables. It would be better ...
2
votes
1answer
37 views

Powershell Array search for keys

I Have an array called $a echo $a gives: url load --- ...
4
votes
1answer
54 views

Powershell - Merging Results in one table

I am new to powershell. I am trying to create a report that shows AD accounts that expire soon. The report should include the User Name, AccountExpirationDate and the Manager. I have the ...
1
vote
0answers
80 views

How do I script a change to the msmq storage location on Windows 2008 R2 server

Is there any way of doing this through a batch or powershell script? I'm looking for a way to set up several new servers. The only thing I found on the subject leads me to believe you cannot: from ...
2
votes
1answer
69 views

How to Automatically Tust Auto Enrolled Code Signing Certificates

In my organization all developers are setup to be granted a Code signing certificate via Auto Enrollment. Additionally, PowerShell is configured by group policy to require all scripts to be signed. ...
1
vote
1answer
201 views

How do I find the mailbox name for an exchange 2010 account so I can connect using mapi

I was redirected here from Stack Overflow, so my apologies if this happens to be off topic. I have an issue at the moment where I am trying to set up a connection between my exchange account and a ...
7
votes
2answers
526 views

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

Deleted GAL in EMC and ADSIEDIT now Error

I attempted to delete a Global Address List via Exchange Management Console and ADSIEDIT as I made a typo during the creation. Now when I try to create a new GAL, i get the following error [PS] ...
2
votes
1answer
796 views

Using Powershell to update users home directory

I am trying to change the home directory path to a bunch of users. I wrote a script in Ppowershell which should change the path the username like so: \\serverName\shareName\$_.SamAccountName The ...
1
vote
0answers
15 views

Does Stop-CauRun Stop the Current Server or the Whole CAU action?

When using a PreUpdateScript or PostUpdateScript with "Windows Cluster Aware Updating" and "Updating Run Profiles" would calling the cmdlet Stop-CauRun do any of the following: Would it actually ...
0
votes
1answer
64 views

List mapped zombie drives in powershell

I'm writing a little powershell script for some basic logs that have to be generated. Right now I'm stuck with logging mapped network drives: $colDrives = Get-WmiObject Win32_MappedLogicalDisk ...
2
votes
0answers
321 views

How to retrieve a MDT task sequence variable and use it properly inside Powershell

I'm trying to retrieve a MDT task sequence variable inside a Powershell script, then use that variable in a Powershell function. My problem lies in that the variable I want to retrieve contains a ...
1
vote
1answer
142 views

How do I take an eml file and place it in the inbox for journaling, without sending the email?

I have an archiving system that reads both envelope and legacy journaling messages in an Exchange 2010 environment. The journaling target is simply a mailbox that receives a copy of every SMTP ...
4
votes
1answer
1k views

Batch script is not getting executed when called by Start-Process Cmdlet

I have a strange issue on a Windows Server 2012 R2 here that just does not make any sense to me at all. I've got a PowerShell script that basically has the following structure: Function ...
1
vote
0answers
96 views

Can not install Office 2010 via winrm

I am trying to install Microsoft Office 2010, I have created a MSP and config.xml file so I can do this from Powershell, using the following command: Start-Process "C:\temp\Office2010\x86\setup.exe" ...
2
votes
2answers
90 views

How can I speed up PowerShell cmdlets that are using the -CimSession parameter?

As the title says, how could someone speed up the execution of this tiny script? Am I using the New-CimSession that right way anyway? $computers = Get-ADComputer -SearchBase ...
5
votes
2answers
323 views

Is there a way to tell how long a machine has been in an security group?

Machines get added to a security group to prevent them from getting a GPO. I'd like the machines to get removed after 30 days of being in the group. Ideally, I'd like to also be able to generate a ...
0
votes
0answers
496 views

Batch/Powershell file wont run via Task Scheduler during logoff

I'm having trouble getting my Powershell file to run from Task Schedule during logoff. In short, I'm trying to upload my NTUSER.DAT (roaming profile) to my profiles folder on the file server. Dynamic ...
0
votes
0answers
54 views

Powershell and dsget do not return full results when querying group membership

I'm trying to get information about group membership of certain users. Ultimately I want to automate this in some way but I'm having difficulty extracting the information at all. The problem is that ...
0
votes
1answer
93 views

Powershell AD Group creation script

I am making an AD Group creation script New-ADGroup -Name "CS-WS-PROD-Admin" -GroupCategory Security -GroupScope Global -Path "$OU" -Description "Admin Rights on PROD" -ManagedBy CS-WS-SAR-ADMINS ...
7
votes
2answers
236 views

What's the difference between Remove-WindowsFeature and Uninstall-WindowsFeature?

What's the difference between Remove-WindowsFeature and Uninstall-WindowsFeature? I've used Add- and Remove- on Windows 2008 R2 boxes, but there is now an Install- and Uninstall- which according to ...