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
1answer
155 views

Powershell - Windows forms - script calling another script, 2nd script modifying form elements [closed]

I'm developing a Powershell script that's going to present the user with a GUI. When the user presses a button in the GUI, I want it to call, (execute), a 2nd powershell script, the 2nd script will ...
1
vote
1answer
45 views

Using reflection in Powershell with different .NET framework versions

I am trying to reflect some assembly attributes from a .NET assembly. I am using Powershell 2.0, but the assembly was written using .NET Framework 4.5.1, so when I try the following command: ...
1
vote
1answer
119 views

Allow Enter-PSSession to work from local systems account

I have a PowerShell script that creates a Windows PowerShell session (PSSession) on a remote server via Enter-PSSession, both servers are not connected to a DOMAIN. This script is called from a ...
0
votes
2answers
57 views

Static IP injection to guest VM in Win2k8

Is there a way to inject IP address and do network configuration of a CentOS VM running on Windows server 2008? In Win2k12 there is SetGuestNetworkAdapterConfiguration using which IP address can be ...
0
votes
1answer
44 views

Powershell - Using a WHERE clause after an @{name alias not returning anything

Can I not use a WHERE in the pipe after an @{name alias? I have to use custom column headers in my output so I am using the @{name syntax. Later in the pipe, the sort works using the alias I've given ...
0
votes
0answers
22 views

EventLog Source “Connect”. No events in EventLog

I'm baffled by this, as I can find no documentation on wether or not "Connect" or "Connection" is some kind of registered keyword for EventLog Sources. I'm trying to create an EventLog Source called ...
0
votes
0answers
54 views

Exchange 2013 Powershell: Setting up Public Folder Mailbox in multi-tenant topography

My exchange system has multiple habitats/tenants (i.e. domains). How do I set my public folder mailbox system? Do I set one up for each habitat (tenant)? If so, what is the syntax? Or do I set one ...
0
votes
0answers
43 views

CloudFormation powershell to run as domain admin + elevated priviledge

So... I'm writing some cloud formation templates. Using cfn-init, I get the machine to join the domain, and now I need to run in a Domain Admin context as local admin with elevated privilege to: ...
0
votes
1answer
35 views

Allowing multiple executables into a “Run only specified applications” group policy at one time

At my workplace we whitelist executables using a "Run only specified Windows applications" group policy applied to the domain. At certain times we need to whitelist large number of executables at a ...
2
votes
4answers
140 views

Different group policies in one domain

I'm using powershell to display the password expiration of an account before I reset it at work. But the global GP from what I can see, is 180 days, and there are some employees who have 90 days set ...
1
vote
3answers
850 views

How can I automate and run post installation commands in Azure Virtual Machines?

I need to deploy Azure hosts and configure them according to a pre-defined script once they are loaded. Is there any example, guidance,or tutorial on how to modify an Azure VM once the instance is ...
1
vote
1answer
76 views

Some groups show no members in Get-ADGroup

So I have a question about strange PowerShell behavior with Get-ADGroup. If I use it on a group I created, I can get members just fine. But on some (not all) built in groups, including Domain Users, ...
6
votes
2answers
22k views

Can't give 'send-as' permissions in Exchange 2010

I'm trying to give 'send-as' permissions to one user in Exchange 2010. Here is the Powershell command I'm running: Add-ADPermission "User1" -User "Ourdomain\User2" -Extendedrights "Send As" ...
0
votes
1answer
31 views

Need looping Powershell script to email me when site has error message [closed]

Running 08 windows server on a VM We need to be notified by email or by other means whenever the site is either 404 or goes to maintenance page. Therefore, we need the script to be constantly ...
2
votes
1answer
2k 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 | ...
1
vote
1answer
365 views

Windows 2012 R2 RDS - can't change Connection Broker DNS round robin name via Powershell

I'm running into an issue when setting up a Windows 2012 R2 RDS Farm. I mistakenly set up my High Availability Connection Broker's DNS round robin name to something that didn't match my cert. I ...
-1
votes
2answers
46 views

Prevent windows users from logging into, pinging, or browsing other workstations [closed]

Bluecoat security did an analysis of the Sony attack and says the following "This particular sample highlights the value of a network architecture where workstations cannot talk to each. While ...
1
vote
2answers
77 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 ...
3
votes
8answers
33k views

Powershell 2: Add multiple members to distribution group with one call?

Assume I have a distribution group in Exchange which currently exists, and holds about 20 members. In Powershell 2, I have acquired a list of about seven hundred more individuals who need to be added ...
6
votes
6answers
6k views

How to enable volume shadow copy using Powershell?

How to enable volume shadow copy on specific drive (D:, E:,...) and set up schedule using Powershell ? I just need some hints how to start.
1
vote
3answers
225 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) { ...
2
votes
2answers
77 views

How can I speed up PowerShell cmdlets that are using the -CimSession parameter?

As the title says, how could someone speed up the execution of this tiny script? Am I using the New-CimSession that right way anyway? $computers = Get-ADComputer -SearchBase ...
2
votes
2answers
258 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 ...
3
votes
3answers
67 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 ...
0
votes
1answer
80 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 ...
3
votes
2answers
403 views

What do the contents of PowerShell's $PSVersionTable represent?

If I echo $PSVersionTable in PowerShell, I get what appears to be multiple bits of version information. The name's of the properties are CLRVersion BuildVersion PSVersion WSManStackVersion ...
4
votes
1answer
78 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
76 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
72 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. ...
0
votes
1answer
66 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 ...
0
votes
1answer
60 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 ...
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 ...
1
vote
4answers
1k views

Start-BitsTransfer Works when triggered manually from powershell but not using a windows service

I'm using BITS to transfer file from one windows 2008 R2 server to the other. When I run the command manually from powershell or regular command line it works perfectly. Now when I use the same ...
-1
votes
1answer
69 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
2answers
67 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
3answers
75 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
33 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 = ''}; ...
2
votes
1answer
157 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 ...
1
vote
2answers
3k 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
101 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
0answers
88 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
63 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
2answers
331 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
2answers
446 views

Cannot change default OU for new Distribution Groups in Exchange 2010

I'm trying to use the following command to set the default OU for new distribution groups in Exchange 2010: Set-OrganizationConfig -DistributioNGroupDefaultOU 'corp.company.com/Employees/MailingList' ...
0
votes
1answer
71 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
2answers
533 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 ...
2
votes
1answer
370 views

New-PSSession across domain boundaries

I am trying to bring up a virtual machine that needs to be able to create new sessions (with New-PSSession). The highly engaging about_Remote_Troubleshooting is my constant companion, of course! ...
89
votes
9answers
83k views

How to zip/unzip files in Powershell?

Is there a one-liner that will zip/unzip files (*.zip) in PowerShell?
8
votes
4answers
342 views

Test-Cluster Powershell cmdlet List vs Validate

The Powershell cmdlet Test-Cluster queries a myriad of data and performs validation tests which it wraps into a pretty report. If you run Test-Cluster -List you get a list of item's you can ...
1
vote
0answers
106 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 ...