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
vote
2answers
505 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
259 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
285 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
72 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
569 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
314 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
183 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
477 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
204 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
3k 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
729 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
221 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
935 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
322 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
90 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
320 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 ...
0
votes
1answer
346 views

lookup file name in sql and rename file

I am trying to use a Powershell script to use the account number in a file name and re-name with the ID number from a sql database. Below is the code I am using to attempt this and I am not getting ...
5
votes
2answers
3k 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 ...
0
votes
1answer
606 views

Use SCOM 2012, WMI, or Powershell to identify all servers that have hyper threading turned off

We recently setup SCOM 2012 and deployed agents to all of our servers. We also have noticed that a number of these servers do not have hyper threading enabled, which they should. Is there any way we ...
3
votes
2answers
192 views

Can I use a powershell script to install db/website when the database is separated from the webserver?

My boss is on vacation and I'm supposed to have this installation script done by the time he returns. Unfortunately, I've realized that the script I developed won't work on the target server setup and ...
1
vote
1answer
1k views

How to start SMTP [SMTP Virtual Server #1] through powershell or command prompt

Because of some error on my server my SMTP [SMTP Virtual Server #1] stop. I wanted to create job which will run periodic timely and check the SMTP server status, If its stop then it will start it ...
2
votes
1answer
3k views

PowerShell script not completing what it should do when scheduled with Windows Task Scheduler

I found a script that can delete files over X days old and changed it a bit so that I will scan different network folders to see if there are files that are older than X days. Now when I run the ...
0
votes
3answers
784 views

How to use powershell to check the location of user profile locations on the server?

Is it possible to find all the users profiles that are not on a certain server/folder using powershell and regular expressions? If so how would one go about this?
9
votes
1answer
1k views

What the heck is going on with this AD filter in PowerShell?

I recently wrote this answer and stumbled on something interesting. get-aduser -filter {-not (description -eq "auto")} | measure-object and get-aduser -filter {description -ne "auto"} | ...
1
vote
1answer
202 views

Using Powershell command New-AUDser to set -HomeDrive and -HomeDirectory

I'm trying to create a new user in AD with the New-ADUser command. When i look in the Users and Computers gui, all the parameters i've passed through powershell, is populated to correct fields, ...
4
votes
2answers
508 views

Powershell script to copy file named 'dat' from multiple folders

I am trying to copy a file named 'dat'. This file has no extension. The thing is though that under a Parent Folder 'Personal' I have 500 folders and all of these 500 folders have the 'dat' file. I am ...
2
votes
2answers
10k views

Run Elevated Powershell prompt from command-line

Is there a way to run a Powershell Prompt with Elevated privileges from a command linein Server 2012? Problem is this is 'Minimal Server Interface' mode without full server-gui installed so I can run ...
0
votes
1answer
300 views

Unable to create zip files with shell.application [closed]

The following example doesn't seem to work on my Windows Server 2008 SP2 nor my Windows 7 Pro Sp1. Command: $shellapp = new-object -com shell.application $shellapp Output: Application ...
0
votes
0answers
215 views

Querying boot order with powershell in vsphere

We have any environment with thousands of virtual desktop hosted on a vshpere hypervisor. I'm looking for a way to check the boot order in the bios of each vm to ensure they all are set up properly. ...
2
votes
2answers
257 views

Remove email addresses by policy

Is there any elegant way to remove email addresses from users using automation, Powershell or Exchange Email Address Policies? The platform in question is Exchange 2007. I would like to modify email ...
0
votes
1answer
424 views

PowerShell send-MailMessage fails: “Configuration system failed to initialize”

I am running Server 2003 x86, and I have PowerShell 2.0 installed. When I type send-MailMessage in PowerShell, I get this error: "Configuration system failed to initialize". I get a similar error ...
0
votes
1answer
1k views

Uninstalling KB2506143 (WMF 3.0) from Windows 2008R2 with Exchange 2010 SP2 doesn't work

KB2506143 was installed on Exchange 2010 SP2 machine on Windows 2008 R2. Since WMF 3.0 was installed Rollup Updates cannot be installed as they fail on starting some PowerShell scripts. Normal ...
1
vote
1answer
2k views

SQL Agent Powershell Job Failing with Non-Admin Proxy

I'm attempting to create a SQL Agent job that will run a PowerShell script that is saved on my system. However, the job fails with the following error: A job step received an error at line 1 in a ...
2
votes
1answer
2k views

Mirror directory, only purging files in destination directory older than 7 days

I would like to mirror a directory, but only delete files in the destination directory older than 7 days. Situation: - Directory A is mirrored to Directory B. - A file from Directory A is deleted ...
3
votes
1answer
2k views

Give AD Security Group Exchange Full Access Permission

My company is running Exchange 2007. From time to time, we need to open a user's Mailbox to to various tasks. Until now, we've been logging is as them and using Outlook directly. I'd like to give Full ...
3
votes
1answer
580 views

How can I automatically delete /tmp folder on shared drive?

We have a /tmp folder that people use for temporary stuff. It can be anything and any file. We want to make it so that this automatically deletes (or preferably MOVES to another folder on the same ...
4
votes
1answer
645 views

Diskpart breaking drive letters after powershell script is run

I built a script that mounts (attach) a VHD using Diskpart, cleans out some system files and then unmounts (detach) it. It uses a foreach loop and is suppose to clean multiple VHD using the same drive ...
0
votes
1answer
318 views

Robocopy Copy “For Loop”

I'm trying to create a simple script that will robocopy several folders using the command below. When one folder is done copying, it moves on to the next. Does anyone have a batch/powershell for loop ...