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)

3
votes
1answer
439 views

Systems Center service template including AD

I'm trying to design an SCVMM (2012 SP1) service template that contains several machines joined in a domain, but the trick is that the very domain controller is also in the template. Ie. the template ...
3
votes
2answers
3k views

How to get a list of emails older than 2 years in Exchange Database, sorted by user, using Powershell?

We are currently looking at archiving emails and revamping our retention policy. The big question is (for the legal department), how far back do we want to save? Currently our users have a huge ...
5
votes
1answer
4k views

Rename displayName and CN from givenName and surName with Powershell?

I need to reconcile the displayName and CN attributes to the givenName and surName fields in AD. Is it possible to take givenName and surName and rename both the displayName and CN using Powershell?
0
votes
1answer
209 views

Hyper-V and Windows Server with Powershell/Automated?

So my work is looking into Automating Hyper-V Servers for Test Environments, Basically in the end we want to have a sort of Web/Form interface for selecting a server spin up. Right now it's done ...
1
vote
1answer
227 views

PowerShell: replacing AD DS ACLs

I am looking for a code sample showing how a permission set on a given Active Directory object (in my case an Organizational Unit) could be modified in a way where permissions for a given security ...
2
votes
1answer
2k views

Powershell remoting to a server using CNAME, not COMPUTER NAME

I am trying to get powershell remoting to work with a server using it's CNAME rather than the computer name. Both local and remote machines are on the same network and domain. I have enabled ...
2
votes
1answer
79 views

How Can I Source My $Profile From A Powershell Function?

I like to make a lot of changes to my $profile file. After saving a change, I would like to source the file using an "sop" alias. Here's how I hope to accomplish that: set-alias sop Source-Profile ...
1
vote
1answer
95 views

Is Microsoft .NET Framework Client Profile enough for PowerShell to work on a Windows XP workstation?

Is Microsoft .NET Framework Client Profile enough for PowerShell to work on a Windows XP workstation? Or is a full .NET version needed to be installed? Are there any advantages for the full ...
0
votes
1answer
2k views

Remotely execute application on another PC connected via a crossover cable

I have two PCs that are both running Windows XP SP3, referred to as PC1 and PC2. They are connected to each other through cross-over ethernet cable. PC1 has the static IP address 10.0.0.1 and PC2 has ...
3
votes
1answer
192 views

How can I add a user's domain information to the pipeline in PowerShell when using Get-ADUser?

I'm trying to enumerate the name, samaccountname, and domain that each user in my forest belongs to and write it to a text file. The script that I have now is: Import-Module ActiveDirectory ...
1
vote
1answer
496 views

Access Denied when creating a scheduled task with powershell and the com schedule.service object

I have a powershell script that creates a scheduled task using a call to RegisterTask via the Schedule.Service com object. Essentially: $ts = new-object -com Schedule.Service $ts.Connect() ...
0
votes
1answer
687 views

Powershell script to insert SQL Statement with a apostrophe error

I have the following part of a script that takes objects form Exchange and AD and inserts into a MYSQL table. But some of the Full Names variables have a ' like the distribution group PA's. Here's ...
0
votes
2answers
519 views

Powershell backup log to csv

Hi I have learned a short command to create a CSV from the backup log on my server. I have 5 of them and I wonder if there is a way to show their result in a website format on one pages. The whole aim ...
0
votes
1answer
803 views

Get Undeliverable Email Addresses Using Powershell

Exchange Server 2010 I am trying to use Powershell to get the email addresses that were returned as Undeliverable. I've tried a bunch of Powershell commands, but I always get the ...
1
vote
1answer
498 views

Use PowerShell to edit a remote file on a Windows 2008 Server

Editing a file on a remote linux server via SSH and vim is something I usually do on a regular basis. Recently, I got on a new web project involving Microsoft technologies instead of the usual open ...
0
votes
1answer
872 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 ...
0
votes
1answer
73 views

single or set of patches from windows update?

Is there a way to install several patches by kb or other means and only install those specific without manually downloading the patches? I want to use automatic update services but don't want every ...
1
vote
3answers
273 views

Does Windows 2012 Server needed to be a Domain Controler for Using it as AD Webservices for Powershell

I am trying to achieve the make use of AD administrative commands such as "Get-ADUser" and "Get-ADComputer" via Powershell. All our domain controllers are Windows 2003 and we have one Windows 2012 ...
1
vote
1answer
485 views

Toggling enabled/disabled on specific triggers in a task in the task scheduler using powershell (or something else)

Related to this question: Windows Server in UTC, need Task Scheduler to shift tasks with summer time and this question: ...
1
vote
1answer
221 views

Discrepancy between Event Log taken from Powershell and with Event Log Viewer

Domain Controller OS - Window Server 2008 R2 Please see the First PrintScreen attached (Powershell.png). with the help of Powershell command I am trying to check the event Log of my DC. Please note ...
1
vote
2answers
1k views

Trying to set COM+ application component properties in PowerShell

I have this script where I'm trying to set the IISIntrinsic property for components of an application in Com+ in Component Services. This is what I'm trying to tick Here's my powershell script: ...
2
votes
1answer
2k views

How to take ownership of a security group as the Exchange administrator?

We are using Exchange 2010 as part of an Office 365 subscription. We have a security group owned by Alice only. Without using Alice's account, how can the administrator take ownership of that security ...
1
vote
2answers
485 views

How do I write a powershell script to install RDS-RD-Server role?

I assumed I would just put the following in a filename.ps1 named file and run it like: powershell.exe -noexit 'filename.ps1' It runs, but it's not doing anything. Inside the filename.ps1 I have ...
3
votes
1answer
2k views

How can I run a PowerShell script during the specialize pass of a WDS deploy?

I'm setting up Windows Deployment Services (WDS) for Windows Server 2012 unattended deployments using the default boot.wim file found on the install media. I have a PowerShell script that performs ...
3
votes
1answer
257 views

Exchange - limit enrollment of ActiveSync devices

Is it possible to modify an ActiveSync policy to prevent a user from having more than one (or any specified number of) device(s) enrolled simultaneously? What would be the Powershell script to do so? ...
5
votes
1answer
2k views

How can I get the “description” attribute of an OU in ActiveDirectory?

I'm working on a set of script that will be used to migrate the users and structure from one active directory to another. For this, I'm using the Get-ADOrganizationalUnit commandlet to export the OUs ...
2
votes
2answers
276 views

Look up where a NTFS group is used

We are doing some AD clean up and migrating or deleting old AD groups and replacing them with our current naming stranded in AD. The challenge that we are running into is making sure we have the we ...
0
votes
1answer
71 views

Commands to manage services and applications in a failover cluster

There is a pretty decent suite of Powershell commandlets for managing Microsoft Failover Clusters, including commands for starting and stopping nodes. However, I am interested in the equivalent ...
1
vote
2answers
3k views

Mailboxes moved and whitespace isn't increasing… aka logical mailbox space not being freed

I understand the difference between "logical" and "physical" free space and have a problem with whitespace not increasing (logical space, formerly event 1221 in Exchange 2003). Given that I have ...
0
votes
2answers
554 views

Ban IP address based on X number of unsuccessful sql server login attempts?

Is it possible to expand on the idea presented in Ban IP address based on X number of unsuccessful login attempts? to encompass IP addresses for repeated failed sql server login attempts? There are ...
1
vote
1answer
300 views

How to give “only append” access to user in windows , for logging purposes

Hi I have a powershell script which takes some data and dumps into a logfile whenever its executed.The script resides in single location and shortcut is distributed to all. I want to log the events ...
0
votes
1answer
176 views

Powershell script to bulk import PSTs into mailboxes based on primary smtp address

I have about 30 PST files which I need to import into mailboxes in Exchange 2010. They are all named by the first part of the email address. For example with johnsmith@domain.com, that PST would be ...
2
votes
2answers
457 views

powershell call operator with multiple arguments?

I am trying to use the powershell call operator to essentially run the following command: "C:\Program Files (x86)\PuTTY\plink.exe" "-v -agent -m C:\Scripts\idrac_powerup_commands.txt ...
2
votes
3answers
1k views

Permissions Issue? Putty + Plink + Pageant + Powershell + Scheduled Task

Background I have the following components: A windows server 2008 R2 box An administrator account (mine) A service account on the domain that is an Administrator of the box An installation of ...
1
vote
1answer
199 views

powershell behavior of select

Can someone explain, why this ( powershell 2.0 ) $wmi=Get-WmiObject Win32_UserProfile $wmi|select *; $wmi|select SID; $wmi|select LocalPath; gives expected results ( selected everything, then ...
0
votes
6answers
2k views

Can I schedule machine boot via Dell iDRAC?

I have a Dell PowerEdge R410 with iDRAC 6 configured and accessible. I know we'll be losing power at some point this weekend and I have a time that I would like to power on the machine again. From ...
1
vote
1answer
2k views

How to change all users Ad Email contact using powershell

I need a script that will change all of my ad users email contact field information. The format will be the "SAMAccountName + @domain.com". I am a powershell noob and need a little help on the syntax. ...
0
votes
2answers
706 views

Powershell changing Date to the first of last month when the script runs [duplicate]

If I run the script on 2/4/2013or any other day in February I want the date to be change to 1/1/2013. I am replacing date on line 59 with this value. #Get the content of the CMS Script. $CMSReport = ...
1
vote
1answer
2k views

replacing a line or date in a text file using powershell

I am trying insert today's date on a text file at line 59. How do i do this? Line 59 has like 30 spaces and then reads like this. After the PowerShell script runs it will change the date so it has to ...
2
votes
1answer
196 views

Powershell script on the hidden file share not accesible on the workstation

We have a PowerShell script script.ps1 on a hidden shared folder \\Server\Share$. We have a bat file Initiator.bat, which executes the script. The shortcut to the batch file is placed on the user's ...
1
vote
1answer
1k views

How to enable SMTP server in Windows Server 2012

We are using servermanager.exe to install smtp server in windows 2008R2 from comand prompt. Is there any alternate to servermanager.exe? How to enable smtp server in windows 2012 from command prompt? ...
1
vote
1answer
218 views

How to install RSAT on remote Windows 7 workstations using Powershell in 2003 AD

How do I install and enable RSAT tools on remote Windows 7 Workstations using Powershell? Actually this process I think has 2 parts: Installing the tools Enabling the features; How can this be ...
0
votes
1answer
134 views

How to create a shortcut to a file on Fileshare and hide the path from user

we are sharing a certain powershell script to our remote users; the powershell script wuill be hosted on the file share and the link(shortcut) to the bat file(which executed the powershell script) ...
0
votes
1answer
1k views

Export hardware specifications to a spreadsheet for Windows Server

I have a bunch of servers : Windows 2003 and 2008. I just wanted to export these hardware specs to a spreadsheet: cpus : num processors, clock speed, etc total hard disk space total used disk space ...
6
votes
3answers
7k views

Run remote powershell as administrator

Before I dive into the question, I have found several other questions that seem similar to mine, but they have not been able to solve my problem. Here are links to them: Remotely run a script ...
2
votes
1answer
921 views

Powershell VMWare Script not running from Scheduled Task

Background / Goal I am attempting to create a scheduled task that will: Run at the specified time (once) Run a PowerShell script that: Logs all of its output as a transcript Connects to my vCenter ...
0
votes
1answer
318 views

powershell script to move backup files

I want to zip sql bakup files and move from one directory to to another directory within a system using powershell 1.0 can you help me since am a beginner
0
votes
1answer
87 views

Pinging the hostname of the server I'm on does not reach out to DNS, responds with 'lowest' numerical IP

For example: Server: server1.contoso.com IPs present on server: Initially configured statically with 10.10.20.100, it had two additional IPs added to the same NIC, 10.10.20.20 and 10.10.20.102. A ...
0
votes
1answer
311 views

Powershell error when adding filepath

The script looks like this: $searchOU='ou=Servers,dc=mydomain,dc=NET' Get-ADComputer -filter * -SearchBase $searchOU | Foreach-Object { $server = $_.Name ...
0
votes
2answers
2k views

Powershell - How to find who is a local administrator on the servers in Active Directory

I would like some help to merge these two scripts, the first one I've made myself the other one is borrowed. How do I get these scripts merged, so I can get list of all the servers and of all members ...