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)

-1
votes
0answers
18 views

Exchange 2007 on SBS 2008 Extreme help needed! Reinstall IIS from Powershell? [on hold]

Hello guys I am facing an extremely serious issue here. 2 night ago I rebooted my server and it installed updates. Once rebooted the next morning users were saying email wasn't working. So I looked ...
3
votes
3answers
47 views

PowerShell: How to retrieve a specific property _exclusively_

How can I retrieve a specific property exclusively? I am aware of the select-object cmdlet which seems to be dowdy in that respect: PS C:\> Get-ADOrganizationalUnit -SearchBase ...
1
vote
3answers
46 views

Powershell Start-process -Argument list not working

Start-Transcript c:\scripts\InstallUpdates.log -Append # -NoClobber $SourceMSUFiles = (get-content install-list.txt | where {$_ -like "*.msu"}) #Install MSU files foreach($file in $SourceMSUFiles) { ...
4
votes
1answer
57 views

Look on all server desktops for outstanding files before deleting profiles

We have about 70 servers that we are in the process of moving into a domain environment, so we are converting our users from local accounts to domain controlled accounts. How can we determine which ...
0
votes
1answer
38 views

Dump user's Exchange mailbox to explorer while retaining folder structure

I have a user who will be retiring in a few days. He's been tasked with dumping out all mail that is related to the organization's customers and classifying it under our organizational structure ...
0
votes
1answer
22 views

WDS - Initial configuration using PowerShell

I am installing WDS on Windows server 2012 R2. I want to use PowerShell from start to finish. I can install the feature, but I cant't find a way to do the initial configuration from the shell. This ...
0
votes
1answer
27 views

Windows Server 2012 RD Licensing Issuing Multiple Temp Licenses Per Machine

I have just setup a Windows Server 2012 RDS environment with Per Device CALs. Looking at RD Licensing Manager it is handing out multiple temp CALS per machine and multiple permanent CALS per machine. ...
-4
votes
0answers
35 views

Send an email using powershell to the local IT administrator [closed]

I am trying to write a Powershell script to send an email to the local IT administrator depending on the computer's location in Active Directory. The script would need to find the computername, then ...
0
votes
1answer
19 views

Need to embed an existing object inside a PSObject

I have a module that does a "get" and returns some information from a VMware host. All the return information is in a NoteProperty. I'd like to add in an type into that PSObject so that I can pipe it ...
1
vote
2answers
55 views

Getting no query results in email

This is the powershell script below. I am trying to export the query's results into email body. However, the email contains nothing except the table headers. Could anyone help out what could be wrong ...
-1
votes
0answers
24 views

Self terminating jobs in powershell 2.0

Is it possible to create a PowerShell job using start-job which will terminate itself once completed? For example the script block would check some conditions and write the result to a log file, after ...
-1
votes
1answer
40 views

Running powershell like a process to monitor for event changes

I would like to have powershell manage network profiles for me depending on where I connect to. Mostly for my three work locations I jump between. I need specific IP off the wireless networks so I can ...
0
votes
0answers
5 views

PowerShell memory leak when use CredSSP [migrated]

I want to write a code to use "Powershell" and create a new session by "CredSSP" authentication, but when I monitor the memory usage for this console, I found something not dispose... so the memory ...
0
votes
1answer
28 views

interpret unknown piece of powershell related to SQL Server

I am migrating from SQL 2008 on Win2003 to SQL 2014 on Win2012. One of the jobs from the old system has this step: if ('$(ESCAPE_SQUOTE(INST))' -eq 'MSSQLSERVER') {$a = '\DEFAULT'} ELSE {$a = ''}; ...
1
vote
3answers
39 views

How to change windows time server on windows server 2012?

In windows computer, system is using "time.windows.com" to sync the time. I need o modify the time server for windows user on its logon and want to enforce using group policy. Case: we have windows ...
0
votes
1answer
42 views

Assigning Department based on Active Directory OU's

We have just gone to Office 365 tied in with ADFS. We want to be able to see people's departments automatically when we view their contact info in Office 365. We do not have any Department ...
2
votes
1answer
118 views

FSRM powershell behavior

I'm working on a script I can push out to a few dozen Windows Server 2012/2012R2 servers to enable FSRM File Screens that will write an alert to the event log when they detect a particular filename ...
0
votes
0answers
7 views

Make Batch file to add special tags at the front of video files at one folder [migrated]

I always make download for learning tutorials videos , Some times I don't remember where I can find those videos because they are too many , so I decide to make tags to those file and put them in ...
0
votes
0answers
27 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
46 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
44 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 ...
1
vote
0answers
25 views

How to close a powershell form which hasn't been closed with form.close [migrated]

While something in powershell to display a few details on a form I came across something I don't know how to deal with. The following code demonstrates the problem: ...
2
votes
2answers
71 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 ...
1
vote
0answers
340 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
42 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
36 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
48 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
80 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
63 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
38 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
60 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
21 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
62 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
102 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
31 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
36 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
13 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
139 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 ...
0
votes
0answers
6 views

Running runas cmd in Powershell [migrated]

I am a beginner and am trying to understand how to use the runas command in Windows Powershell. When I type the following command into Powershell: runas /user:\administrator cmd I am asked ...
1
vote
2answers
70 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
49 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
50 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
40 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
52 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
43 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 ...
2
votes
1answer
54 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
46 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
38 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
42 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
45 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 ...