Tagged Questions

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)

2
votes
1answer
280 views

Nesting PowerShell DSC configurations from different files

If I nest DSC configurations in a single file like this, it works fine: Configuration Secondary { Param ($SomeParameter) Environment Test { Name = $SomeParameter Value = ...
0
votes
2answers
454 views

Powershell script can't open a file when run as a scheduled task

Cross-posting from Stack Overflow because there are probably many more Powershell experts on Server Fault. My Powershell (2.0) script has the following code snippet: $fileName = "c:\reports\1.xlsx" ...
2
votes
1answer
336 views

Can't shut down HyperV VM with Powershell despite admin rights

I am attempting to use a script that shuts down my Hyper-V VMs, copies their VHDs to a target share, then boots them back up. I found the script on spiceworks just a couple days ago. I always receive ...
0
votes
1answer
146 views

clean-mailboxdatabase error : unable to sync mailboxes with DS

Trying to run a script to clean exchange databases. When i run the clean-mailboxdatabase cmd-let I'm getting the following error: Exchange is unable to clean the database that you specified...Unable ...
2
votes
2answers
349 views

Powershell ForEach-Object : Cannot bind parameter

I am trying to get the owner of a process using this code: (Get-WmiObject -class win32_process | where{$_.ProcessName -eq 'explorer.exe'}).getowner() | Foreach-Object user | out-string This works ...
1
vote
2answers
1k views

powershell and using get-eventlog

I am trying to create a script that pulls failed log on attempts for certain events in the past 24 hours but I cant figure out how to pull the account information out. User is Null all the time so ...
0
votes
2answers
194 views

How to collect remote windows logs as a non-admin

I am trying to collect logs from remote windows machines (Windows Server 2008R2 and Windows 7) and I can't figure out a way to do so in such a way that I should still be able to accomplish this ...
8
votes
1answer
325 views

How to accept EULAs for Software updates deployed through SCCM using Powershell

I'm trying to use the Start-CMSoftwareUpdateDeployment cmdlet to deploy a software update group to an existing collection. PS WHO:\> Start-CMSoftwareUpdateDeployment -SoftwareUpdateGroupName ...
0
votes
1answer
168 views

Auto-Tagging EC2 Instances in AWS (Windows Servers only)

I am looking for some guidance from the serverfault community. We are spinning up several new AWS instances (windows server 2008/2012) over the next few days. We have a naming convention in place for ...
0
votes
1answer
159 views

List current Principals in group Managed Service Accounts

Is there a way to list the current list of all the groups and/or hosts in the PrincipalsAllowedToRetrieveManagedPassword property of a gMSA (group Managed Service Account)? There isn't any help on ...
2
votes
1answer
230 views

Drainstopping NLB via powershell remotely

This question was asked by a colleague on SO here, though it was suggested that we ask it here instead - apologies for the cross posting. Server is Windows Server 2008 R2 - UAC is disabled on the ...
0
votes
0answers
1k views

OpenVPN: Setting DNS & WINS servers to Windows client, without DHCP

I have a few Windows 7/8 clients connecting to a Linux OpenVPN Server (tap). I'd like to set the clients' DNS and WINS servers upon connection. The OpenVPN isn't acting as DHCP server; there is an ...
4
votes
2answers
259 views

How to force DSC to execute all configurations (Packages) even when a restart/reboot is required

From MSDN RebootNodeIfNeeded: Certain configuration changes on a target node might require it to be restarted for the changes to be applied. With the value “true,” this property will restart the ...
6
votes
1answer
250 views

DSC, how to know if after running the configuration a reboot is required

So I'm using DSC Push mode I have about 200 deployments per day to several environments (DEV/INT/QA/PROD) Every time that I deploy I want to make sure that each server is configured correctly So ...
12
votes
5answers
4k views

Powershell - Retrieve current domain user's full name

Using Powershell, how can I get the currently logged on domain user's full name? Not only its username. Thanks EDIT: without the need of the activedirectory module!
1
vote
2answers
145 views

Powershell Array - same location combining

I have a script that returns the following information Analog Phones IP Phones Location ------------- --------- -------- 0 883 Site1 413 0 Site1 0 ...
1
vote
3answers
95 views

Displaying all groups that a user from another domain is a member of

My team and I are stumped on this one. We have two domains at work, OldDomain and NewDomain. We are working on migrating from OldDomain to NewDomain as mandated by ParentCompany. The trust is one ...
3
votes
2answers
481 views

Can you use WMI to determine if a connection gets its DNS servers from DHCP?

The DNS server search order for a network interface can be read from Win32_NetworkAdapterConfiguration like this in Powershell, or programmatically using .Net ManagementObjects: > $NICs = ...
0
votes
0answers
272 views

Script to clean out old messages from Journal mailbox after exporting email to .PST

After using the following script to export email to a .PST file I'm wanting to clean out the Journal email box called "JournalMailbox": New-MailboxExportRequest JournalMailbox -FilePath ...
1
vote
1answer
64 views

Does Microsoft Exchange 2010 have two kinds of Distribution Groups?

I was told to add someone to a Distribution Group and when I ran: Get-DistributionGroup -ResultSize Unlimited | Select-Object -ExpandProperty Name from Exchange Management Shell I didn't the ...
1
vote
0answers
92 views

Enter-PSSession returns PSRemotingTransportException

When I try to connect to a distant server using Enter-PSSession, I have a PSRemotingTransportException. It says that the user is either unknown or associated with a wrong password. It works with ...
0
votes
1answer
1k views

Create network shared folder using Powershell on Windows 7

I need to create a shared network folder on windows 7 using PowerShell - I cant get access to New-SmbShare as this is for windows 8 and Windows 2012 Server - any examples would be great. Am I limited ...
0
votes
1answer
159 views

New-ADUser -Path syntax?

Where can I find a detailed explanation of the -Path parameter of the New-ADUser command? I want to specify a rather detailed path without calling Set-Location many times to specify where I want the ...
0
votes
1answer
80 views

Is it possible using powershell or batch scripting to change the meeting organizer for a lot of meetings in one go?

We have an exchange 2003 server, and now for one of my users I've created a separate mailbox for organising meetings for all users. Now I want to move all her existing meetings scheduled for all users ...
0
votes
0answers
66 views

Exchange powershell command set-MailboxJunkEmailConfiguration not responding

I recently needed to remove an address from the blocked sender list on an exchange 2010 server. No biggie I thought and tried it out using this command: set-MailboxJunkEmailConfiguration -identity ...
0
votes
0answers
85 views

Scheduled task deleting itself

I am using PowerShell to create scheduled tasks on my local machine, the Scheduled Task runs a PowerShell script to PowerShell remote into a server and copy files. When I run the Scheduled task using ...
2
votes
2answers
782 views

Powershell - Find users belonging to more than one AD group

I'm new to AD and Powershell so please forgive me if I use the wrong terminology. I have a series of 50+ Active Directory groups called "ABC-something". Every active user needs to belong to exactly ...
1
vote
2answers
1k views

Powershell scan for network attached printers

Currently I'm working on creating a PS script to scan a network and retrieve all of the Windows Servers, their product keys, SQL Server product keys, CPU, RAM, Network Shares and Services on all the ...
0
votes
0answers
110 views

ssh from osx to windows server: how to increase buffer size?

I need to allow mac users to connect to a Windows Server 2008 machine via ssh. I am using freesshd as my ssh server, and have set powershell.exe as my command shell in freesshd (so that they can use ...
0
votes
0answers
82 views

Server migration with a lot of IIS websites - done with PowerShell

We are migrating our last physical machines to virtual machines. Some servers have a lot of IIS websites running. In the past the IIS migration was done manually, but now I would like to use the ...
0
votes
1answer
431 views

StartTime and EndTime params ignored in Set-MailboxAutoReplyConfiguration (Exchange 2013)

I'm using the following command: Set-MailboxAutoReplyConfiguration -identity “First Last” -AutoReplyState enabled -StartTime '3/3/2014 00:00:00' -EndTime '3/8/2014 00:00:00' -InternalMessage ...
0
votes
0answers
107 views

Exchange - setting folder policy with powershell

In Exchange Server 2010, there are known limitations for applying default retention policies to the Notes folder. The work-arounds I found indicate that users should manually set the retention policy ...
-1
votes
1answer
364 views

DNS Record - CHange Current Owenership using Powershell

In DNS I have some computers in the list where the current owner no longer exist so you see the sid info as the Current Owner. I like to change this to the machine_name$. Anyone know how to do this ...
2
votes
2answers
368 views

Providing Read-only permissions to mailbox in Exchange 2010

I need to provide read access to a user in Exchange 2010. No matter how many different variances of the PowerShell I use I get a "Could not expand the folder" error in Outlook, and "Your mailbox ...
1
vote
1answer
92 views

powershell: How to pass this string to an exe

Powershell can't seem to parse this correctly: mysql.exe '-uroot -p123 DB < c:\test\DB.sql' I also tried this: Start-Process mysql.exe -arg '-uroot -p123 DB < c:\test\DB.sql' Edit: Well ...
4
votes
4answers
403 views

Is it possible to disable msiexec help GUI?

I'm automating unattended retrieval & installation of specified .msi packages with a powershell script but if the command is invoked with syntax errors the msiexec will wait indefinitely for an OK ...
0
votes
1answer
198 views

How to automatically create a Hyper-V VM and install an app using PowerShell

I am designing a testing infrastructure for a WPF application. I want a system that will create a VM when a new MSI appears in a folder, and install the MSI on the newly created VM. I am using Hyper-V ...
0
votes
2answers
1k views

“HP Insight Management WBEM Providers” download

I am trying to query a Proliant Server's health thru Powershell. But I can't find a place to download the HP Insight Management WBEM Providers from here. Is there any other Powershell equivalent of ...
0
votes
0answers
39 views

Exchange 2010 Blocking Twitter

I am responsible for a windows network with an Exchange 2010 server. It appears that we haven't been receiving twitter emails for quite sometime, maybe even as far back as just before ...
0
votes
1answer
821 views

Office365 Published Room Calendar shows everything as “Busy”

I am trying to allow people from outside of our organization to properly watch one of the Room Calendars. I managed to successfully publish it using this powershell command: ...
0
votes
1answer
87 views

Powershell - query non-standard group members in an OU?

I am looking to create a script which will only show users in an OU who are members of "non-standard" groups. For example, all users in the "Accounting" OU will be members of at least one group with ...
2
votes
2answers
2k views

Powershell: Single Script to “clean” multiple folders of files older than

I would like to create a maintenance script that would run on each of our servers to clean out common drop/archive directories. Preferably the script would use a reference file for the folder path ...
4
votes
2answers
147 views

OK to modify HKLM\Software\Policies and HKCU\SOFTWARE\Policies on a domain?

Background: I have a domain (2003 Functional Level) with a mix of Windows XP and Windows 7 clients. We have been using Group Policy to manage our workstations. Now, I am in a situation I need to ...
1
vote
2answers
3k views

Cannot get Exchange PowerShell script to run under Scheduled Tasks

I have a PowerShell script that works when entered directly into the PowerShell. The PowerShell program is run with the shorcut: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ...
1
vote
1answer
2k views

Passing arguments to a Powershell Script using Nagios NRPE

Short powershell script for testing: $test = $args[0] echo "this works" echo "I transferred $test" exit 0 nsclient.ini settings: # If you want to fill this file with all avalible options run the ...
0
votes
1answer
92 views

Understanding PowerShell piping/filtering with cmdlets

Consider the following PowerShell commands around failover clustering: Get-ClusterGroup "UKMAC-XA54" | Get-ClusterResource The first cmdlet returns a single ClusterGroup object with the fields ...
0
votes
0answers
51 views

mail routing connection testing

I would like to implement an alerting process that will send a test email to an internet based mail server every 5 minutes, I manually email echo@esat.net if I suspect there is a transmission issue ...
4
votes
2answers
447 views

Why am I getting unauthorized errors with Powershell get-winevent?

I'm a domain admin equivalent, I've tried running in an elevated console (right-click> run as administrator), and I'm consistently getting errors when executing get-winevent -logname application | ...
3
votes
1answer
2k views

How to install PowerShell 3.0 or 4.0 via WSUS

I can't seem to find any information about Windows Management Framework 4.0 on WSUS. As far as I can tell it's not available for approval or download in WSUS, and it looks like Windows Management ...
3
votes
1answer
2k views

How to Export a Registry HIVE (NTUSER.DAT) in PowerShell

In order to resolve a registry bloat issue caused by Samsung Print Drivers I'm needing to find a way to Export a user's Roaming Profile NTUSER.DAT Registry Hive while in PowerShell. Loading and ...