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)

7
votes
2answers
2k views

powershell: How to check if S.M.A.R.T is enabled on remote machines

I was attempting to get disk info of remote machines, including whether or not SMART is enabled on the drive by using the win32_diskdrive class. This is trickier than I thought. While it's easy ...
4
votes
2answers
3k views

Find computers in domain with static IPs - PowerShell

let me start by saying I'm not good at all in writing scripts or troubleshooting them, thus me being here :) I'm trying to find all the computers in a windows domain network that are using static IP ...
5
votes
1answer
1k views

How can I list hidden administrative shares using PowerShell?

I'm trying to write a script that will audit shared folders on a few HIPAA-sensitive servers. I'm getting a list of shares just fine using gwmi Win32_Share, however when I go to get the permissions on ...
1
vote
1answer
634 views

PowerShell Snap-In for IIS 7.0 IIsProviderSnapIn vs WebAdministration

I am attempting to install the Windows PowerShell Snap-In for IIS 7.0 on a server running server 2008 with service pack 2 installed, so I can use the WebAdministration snappin. On Installation I'm ...
5
votes
1answer
4k views

Script to remove Exchange 2010 AutoMapping for all mailboxes

I have an Exchange 2010 SP3 server that's getting Application event error 9646 from MSExchangeIS: Mapi session [ID] [AD User] exceeded the maximum of 500 objects of type "objtFolder" Looking into ...
1
vote
1answer
3k views

SQL PowerShell Snapin Problems

I am hoping this is an easy fix and oversight on my part. I need to be able to run the SQL cmdlets from remote machines. I have installed Microsoft® Windows PowerShell Extensions for SQL Server® 2008 ...
1
vote
1answer
240 views

Windows Powershell - 'MaximumAllowed' parameter in Win32_Share Create method

Any idea what the 'MaximumAllowed' parameter should be set to in order to have the "Maximum allowed" radio button ticked on the shared folder properties in Windows? I know it would be the same as ...
8
votes
2answers
2k views

Detecting AD Site options using PowerShell

How can I use PowerShell to find AD site options like +IS_INTER_SITE_AUTO_TOPOLOGY_DISABLED in PowerShell? I've been playing around with the following command, but can't get it to spit out anything ...
1
vote
1answer
3k views

Sending unauthenticated mail through MS Exchange with powershell (Windows Server 2008 R2)

I'm trying use Task Scheduler to run a powershell script and emails the output of a few commands. I'm using "Send-MailMessage" to do this. When I run the scheduled task with a domain admin account, I ...
3
votes
1answer
234 views

Using Powershell, compare the TimeCreated values of two events and take action if one is older than the other

I've created my own event log called ScriptEvents that I use a few scripts to write to. What I'd like to do is run these commands (or something equivalent): Get-WinEvent -FilterHashtable ...
2
votes
2answers
1k views

How can I get the number of users actively using Lync?

How can I report on the number of users actively using Lync in my organisation? I want to be able to find out what the uptake is. Thought about going through our mail server, but the saved ...
2
votes
2answers
192 views

Can a Windows Server CA separate code-signing keys from keys for other purposes?

I am a software developer. My team encrypts the sensitive sections of our ASP.NET web.config files. aspnet_regiis.exe is used to manage the local key store, encrypt and decrypt. I want to build a ...
3
votes
1answer
417 views

Powershell: get-qadcomputer command

Get-QADComputer -NotLoggedOnFor 90 -SearchRoot 'doman.name/OU1/OU2' I would like to use a variable for the last OU ex: Get-QADComputer -NotLoggedOnFor 90 -SearchRoot 'doman.name/OU1/$OU2' I get ...
1
vote
1answer
2k views

New-ADGroup Parameter for “OtherAttributes” ADGroup Email Address?

Context: I'm trying to create an Active Directory Group with an Email address using PowerShell. Question: What is the corresponding attribute name for the "Email" field? I've searched around the web ...
14
votes
3answers
12k views

Can Remote Desktop Services be deployed and administered by PowerShell alone, without a Domain in WIndows Server 2012 and 2012 R2?

Windows Server 2008 R2 allowed deployment of Terminal Server (Remote Desktop Services) without a domain, and without any insistence on domains. This was very useful, especially for standalone virtual ...
0
votes
1answer
1k views

PowerShell - Delete files based on “LastAccessTime”

I'm trying to run a command that is supposed to delete anything with the "LastAccessTime" older than 30 days. However, when I run it, it just modifies the LastAccessTime and doesn't delete. Command is ...
3
votes
2answers
487 views

Double subnets for a site (AD)

I am trying to create Subnets in existing Sites loaded in from a .txt file. My code looks like this: <#Add subnets to matching sites#> $i=0 foreach($_ in $subnetList){ ...
1
vote
0answers
3k views

Exchange (2013) Powershell Connection Error

I am using Windows 2008 R2 with Exchange 2013 I am trying to connect to my exchange server with the following command but receive an error each time: $session = New-PSSession -ConfigurationName ...
2
votes
2answers
2k views

Powershell-move disabled computers to OU

This prints disabled computer accounts to the screen. I want to run a conditional statement against the results and, if true, move them to my "disabled" OU. get-adcomputer -ldapfilter ...
1
vote
2answers
310 views

powershell script to create exchange report

I have some script write on PowerShell and I have some problem. When I run this script I have some error in output: You cannot call a method on a null-valued expression. At ...
0
votes
1answer
64 views

Phantom Windows PowerShell profile on Windows 7 Enterprise 64-bit

When I start Windows PowerShell in Windows 7 Enterprise 64-bit, it runs an (incorrect) profile -- but I cannot see that PowerShell code in any of my Windows PowerShell profile files. [edit...] So ...
7
votes
1answer
790 views

How to rejoin domain when trust relationship is lost

I have a number of virtual machines which have snapshots applied by using a PowerShell script. Occasionally, the virtual machines lose their "trust relationship" with the domain. This breaks the ...
2
votes
2answers
2k views

Exchange 2010 Powershell: Deleting a Mail Contact associated with a user

Good morning! I have a quick question. How would I delete the mail contact associated with a certain user? This is what I have tried: Get-Mailbox 'jsmith' | select ForwardingAddress | ...
2
votes
1answer
524 views

Powershell - Select-object keeping same columns throughout script

OK. I'm just drawing a blank here or I'm missing something obvious. In a Powershell (V3) script, I'm calling Get-ADUser -Filter 'SAMAccoutnName -like $ADUserName' -Properties ...
0
votes
1answer
87 views

By default, does an Exchange user have the ability to Export the mailbox?

One of our contractors said that by default, it was possible for anyone to connect to the powershell instance of a CAS server and do an Export-mailbox (or similar command) Can anyone tell me if this ...
2
votes
2answers
1k views

Schtasks — what is wrong with the following command

The following script schedules successfully but will not actually, you know, restart the server. schtasks /create /tn "restart test" /ru "domain\admin" /rp supersecret /sc once /st 11:35 /tr ...
0
votes
3answers
2k views

What's a good way to run a point-to-point network speed test over a WAN? [duplicate]

I want to monitor my WAN speed between two offices, and be able to schedule it to run at certain times of the day. I guess in its simplest form this is just a point to point copy, but I want to ...
2
votes
4answers
3k views

How can I pull non-default properties from active directory using get-adgroupmember

When I run: get-adgroup -filter {displayname -eq 'groupname'} | get-adgroupmember | format-table name, surname, givenname, officephone The only field that returns is a default property "name". The ...
0
votes
1answer
3k views

Getting AD username from first name and surname in CSV file

I have a CSV file with a list of users' first and last names, with column headers as Firstname and Surname. I'm trying to extract these users' usernames from the directory by importing the CSV file ...
1
vote
1answer
2k 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
1answer
92 views

Schedule Task 2008 R2 - cmd line requires unix utc time - how to get it dynamically?

These forums are great, and I'm hoping to get some help with a headache I have on doing a process manually that should be easier to automate than I've found it to be. I have a command line tool from ...
5
votes
1answer
1k views

How can I change the IIS default document order using Powershell?

How can I make sure default.aspx is the first default document for my IIS website? I have tried: Add-WebConfiguration //defaultDocument/files "IIS:\sites\Default Web Site\MyWebSite" -atIndex 0 ...
2
votes
3answers
10k views

Add user account to local Administrator group on multiple Windows Server 2008 machines

I have a number of servers to which I need to grant administrative access to 1 particular user, i.e. add him to local admins. I guess it can be scripted with PowerShell or somehow else.. Can somebody ...
1
vote
3answers
1k 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 ...
3
votes
1answer
418 views

Using Powershell (RSAT) to reset passwords in AD (Win Server 2008)

I am using a powershell script I found online, trying to use a win7 cpu to remotely change passwords on a Windows Server 2008 via RSAT. Right now, the server 2008 and win7 are VM's, and the win7 cpu ...
1
vote
2answers
370 views

Pass unlock credentials to powershell script

I have a powershell script that is run as a scheduled task and is triggered to run "On workstation unlock". The script is programmed to reconnect an SSTP VPN connection if the connection becomes ...
5
votes
1answer
3k views

Assign Static MAC address to VM Hyperv

I have a scenario that involves building out a ton of virtual machines in Hyper-V, I cannot use SCVMM and must use a scripted method to create these VMs. I have a CSV with all required information ...
0
votes
1answer
1k views

Exchange 2010 powershell set ProhibitSendQuota equal to ProhibitSendReceiveQuota

I need to set the Exchange mailbox property ProhibitSendQuota equal as the ProhibitSendReceiveQuota, but my powershell fails as follows: Get-Mailbox -Identity 'name.surname' | Set-Mailbox $_ ...
3
votes
1answer
725 views

How to load MSMQ cmdlets in Windows 7?

Technet has a nice article (Windows PowerShell for Windows Server 2012 and Windows 8) listing a myriad of PowerShell cmdlets available on the latest OSes. Often there are easy (or not so easy:-) ways ...
0
votes
2answers
1k views

Set group permission on folder

I have a folder with lots of subfolders D:\Data\Subfolder1 D:\Data\Subfolder2 D:\Data\Subfolder3 D:\Data\Subfolder4 D:\Data\Subfolder5 ... I need to create three active directory groups ...
2
votes
2answers
268 views

Can you use Powershell Remotely to reset AD passwords for Server 2008

Young intern here with a powershell project. My goal is to use a domain computer with administrative [domain] rights to reset user passwords in AD from our server. In order to do so, I have installed ...
0
votes
1answer
3k views

Using Powershell to Create Exchange Contacts from a .CSV file

What I would like to do is use a Powershell script to create Contacts within a certain folder in Active Directory from a .csv file. This script should allow me to create the first part of an email ...
1
vote
3answers
422 views

'exit status' of a powershell pipeline

How do I check for the success/failure of a pipeline from within the same executing script? Get-VM -Name Machine | Get-Snapshot | Where {$_.Created -lt (Get-Date).AddDays(-1)} | Remove-Snapshot ...
1
vote
1answer
952 views

IIS Powershell : Assign an existing SSL binding to a website

I already have an SSL binding created for one of my websites in IIS 7.5. Now I'm adding another website which listens on the same IP and port (443) but uses a different host header. When I try to ...
1
vote
1answer
357 views

Scripting WINS Tombstone Removal

I'm creating a script to remove the tombstoned entries in WINS (required for exchange w/ multi domains). What I'd like to know is if removing those old entries will break anything? Or if there's ...
4
votes
2answers
1k views

How to get from a Hyper-V 2008 R2 node with Powershell the IP address and Vlan ID

I tried to take from the Hyper-V (Hyper-V 2012) node with this command the IP address: Get-VM | select -ExpandProperty networkadapters | select vmname, ipaddress The thing is that i take as an ...
1
vote
2answers
580 views

Get IP or MAC addresses of Windows Multipoint Server 2012 stations?

Is it possible to programmatically retrieve the IP or MAC address of a station assigned to a Windows MultiPoint Server 2012 host, using PowerShell or any other .NET or Windows API? Background: I'm ...
2
votes
1answer
353 views

Cannot Create InboxRule on one individual mailbox

This one user when trying to create a rule through outlook throws the generic "One or more rules cannot be uploaded to Microsoft Exchange and have been deactivated. This could be because some of the ...
-1
votes
1answer
261 views

portqry to check connectivity

Is it possible to check the connectivity between 2 remote servers using portqry given that the portqry.exe command is executed on another server. for example, check the connectivity between serverA ...
2
votes
1answer
495 views

Microsoft Exchange Management console, Initilization Failed

Upon starting Exchange Management Console I am presented with the error [###################] Connecting to remote server failed with the following error message : The WinRM client sent a request to ...