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)

0
votes
1answer
108 views

Importing ExtensionAttribute via CSV with Powershell

I am trying to populate the attribute ExtensionAttribute7 with a CSV file. The CSV file has two columns: samAccountName and ExtensionAttribute7 I import the Active Directory module and have been ...
0
votes
1answer
86 views

Having trouble passing a PowerShell variable to a command line argument

I am working on a script that takes a powershell variable and uses it in a script block running the net command. Here is the code: $User = "domain\user" Invoke-Command -ComputerName $ComputerName -...
0
votes
2answers
189 views

Powershell connection to exchange 2013 powershell works randomly?

I am currently working on a script that connects to our mailserver and purges a specific folder in a mailbox, I got everything working without a problem except the connecting to the server. When I ...
0
votes
0answers
93 views

How to run PowerShell ActiveDirectory command Get-ADObject over SSL

To query AD DS or AD LDS, I can successfully run the following Powershell commands: get-adrootdse -server 'localhost:389' get-adobject -server 'localhost:389' -searchbase 'dc=test,dc=com' -...
1
vote
1answer
103 views

Powershell module 'servermanager' not found on Windows 10

I am running windows 10 on a virtual machine and I would like to list the windows feature available by running the following commands on powershell: Import-Module ServerManager Get-WindowsFeature ...
3
votes
1answer
36 views

Find where powershell onload settings are

On a corporate machine, whenever one attempts to open Powershell, Powershell sends many requests to domain controllers. This would be find if the machine was on the network, but when it's not, then it ...
1
vote
1answer
70 views

clamav: cannot scan from a file list on Windows?

salt win8 grains.item osfullname win8: ---------- osfullname: Microsoft Windows 8.1 Enterprise Evaluation salt win8 cmd.run shell='powershell' '& "C:\\Program Files\\ClamAV-x64\...
3
votes
1answer
42 views

Exchange 2010 address location

Can someone tell me where Exchange 2010 stores e-mail address information? Has it moved from the proxyAddresses attribute in ActiveDirectory? Does "(Get-Mailbox).EmailAddresses" give the same info ...
0
votes
1answer
38 views

how to fetch details from multiple domain

I am trying to create AD report in html via powershell but unable to fetch details from multiple domain, below is my code, # HTML Style $a = "<style>" $a = $a + "BODY{background-color:...
1
vote
1answer
71 views

Powershell script to create folder based on username and then move profile data

I am having to create a solution to backup user profiles on a domain (not VDI's) I have the following script that I got to copy the favorites folder, the issue I am having is that I need the script to ...
-1
votes
1answer
47 views

How to get member of details recently created ad users via powershell in html

I am trying to fetch ad user created details, but unable to get member of details, below is my script $date = (Get-Date).AddDays(-7) Get-ADUser -Filter * -Properties * |where { $_.whenCreated -ge $...
0
votes
1answer
51 views

Exchange 2007 Management Shell (EMS) not working

Windows Server Standard FE (2008) - Service Pack 2 (SBS) Exchange 2007 (08.01.0436.000) - Version 8.1 (Build 2406) (Tried to find the Service Pack version, but the only way that I can see to do this ...
4
votes
1answer
61 views

Change active directory display name format in PowerShell?

Is there a way, using PowerShell, to change the AD format of the usernames to Lastname, Firstname? I know how to do it manually like the answer given here. I am trying to see if I can add this to a ...
4
votes
1answer
109 views

PowerShell: export GPO to a text file

I'm new to Windows Server, and I'm curious: is there any way to dump group security settings to a text file, using PowerShell or batch files? Thank you!
2
votes
2answers
85 views

Active Directory PowerShell Script select field and add to another field

I'm trying to come up with a script to take a field from a user (OfficeNumber) in AD and move it to another user field (HomeNumber) proceeding by an 800 number. So essentially what we are doing is ...
0
votes
0answers
36 views

Windows Server 2012: Dump local security setting to a txt file

Is it possible to dump the local security settings to a txt file using PowerShell or a batch script?
1
vote
1answer
42 views

Delete all files which contain a string & is a specific size in Powershell

I need a script that looks at a directory, select the ones that has a string in its content and is "8" in length(size). I've tried to do this like that, but somehow it doesn't work. Any tips? Get-...
1
vote
1answer
77 views

Find Stale/Inactive Exchange Mailboxes

Hoping someone can help with this/it's an easy to explain issue, but basically I'm looking to find mailboxes in our Exchange 2010 environment that haven't been logged into for more than x days/a ...
1
vote
0answers
62 views

Powershell command works in local PS prompt, but not in a remote PS prompt

I am just beginning to use PS Remoting to administer servers but have run into a snag. When I am at the local server command line, I can run a command like Get-DfsReplicationGroup and the prompt ...
2
votes
0answers
106 views

Get-WmiObject Win32_PerfFormattedData_Tcpip_NetworkInterface results in 'Invalid Class' error

On of my Nagios plugins to monitor the network load gives me problems on one Windows 2008 R2 server (out of 600). You can download the plugin here: https://github.com/willemdh/...
0
votes
0answers
124 views

Run logon command as administrator Windows 10

I've looked around and couldn't find a answer to this exact question. I am working on building a Windows 10 image to push to a bunch of computers using Clonezilla and I am trying to get the unattend ...
1
vote
1answer
42 views

Generate Last logon report exchange server powshell

With this command in shell get-MailboxStatistics -Server servername | Select-Object DisplayName | Sort LastLogonTime -Descending | Export-csv c:\export.csv I am able to generate a full reports of ...
0
votes
0answers
39 views

windows server 2012-R2 : how to do vpn client and server via script?

On linux I can write two scripts: Server: one script (pretty simple) to set up and start ssh server, open iptables for inbound, listen for connections and allow appro access levels Client one ...
0
votes
2answers
79 views

Server 2008 R2 PS script cannot update Active Directory

I have a Powershell script that updates users attributes in Active Directory that runs just fine from the PowerShell ISE. However when I try to run the script as a scheduled task it cannot access ...
1
vote
2answers
63 views

Powershell Passing Funtion Varible for System.Net.DNS

Recently I have been working on trying to parse thru a series of servers for DNS information. I can't seem to correctly pass the variable to the function. Calling the function by itself and passing ...
2
votes
1answer
69 views

When I add users to a Security Group using Powershell, they don't show up in AD

I have a script which has the following for adding users using a CSV file, in Powershell. Windows Server 2008 R2. looks like this: Import-Csv "C:\Users\me\Desktop\users.csv" | Where-Object {$_.Name} ...
2
votes
1answer
122 views

Automatically run PowerShell script at first boot

We use Hyper-V + SCVMM to host Windows Server 2012 (R2) virtual machines. Currently our deployment procedure includes a lot of PowerShell commands that we have to copy/paste after the VMM template is ...
1
vote
2answers
92 views

Windows: Escape spaces in command

I'm trying to execute a simple command with path containing spaces $solution = "test.sln" $msbuild = "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" Exec { iex "$msbuild `"$solution`" /t:clean"}...
0
votes
1answer
229 views

PowerShell: How to get local users and local groups, but exclude disabled accounts

I got a PowerShell command that gives me a list of users and the groups those users are members of. The only problem is that is gives me every user including those that are disabled. I need to be ...
1
vote
1answer
113 views

Associate a Public IP in an Azure Resource Group to a Web App?

I'm playing around with Azure Resource Groups. I've created a group, and in it, I've created a web app. (This is all just academic and I'll delete it all when I'm done leaning, so I don't mind ...
1
vote
1answer
63 views

Remotely change local group policy server 2008R2

I'm trying to find a way I can edit the 'trusted hosts' list under local group policy remotely. Path from within Local Group Policy is: \local computer policy\computer configuration\administrative ...
0
votes
0answers
39 views

New admin account cannot remote powershell in

I have provisioned a new Azure VM which deploys with 1 admin account, which I can use externally to create a remote Powershell session to the VM. If I RDP onto the VM, create a new user which is a ...
0
votes
0answers
72 views

Silent SQL Server install through Powershell fails with Access Denied

When using a remote Powershell session, logged in as the system admin account, to do a silent install of SQL Server 2014, it fails with: Message: There was an error generating the XML ...
0
votes
0answers
34 views

Configuring IIS 7 SMTP settings via powershell

I need to touch up the list of IP addresses that can relay through my SMTP virtual server in IIS. I've been trying to get a handle on what cmdlets and to use in my script but am struggling a bit. ...
0
votes
2answers
63 views

Powershell split-path formatting

I'm having some issues on some of the formatting. My code looks for the new files in a folder structure and returns those items, but I would like to trim the result to only show the first 3 folders ...
0
votes
1answer
154 views

Move emails older than x date to deleted items folder via powershell

I am trying to move e-mails older than 1 year, or any date for that matter, to the deleted items folder via power shell. I've tried running : Get-Mailbox -Identity myuser | Search-Mailbox -...
4
votes
2answers
754 views

Install .NET 4.6.1 remotely via powershell

I am trying to remotely install .NET framework4.6.1 on a large group of machines. I'm using powershell to remotely script this. The problem is that for whatever reason the .exe does not seem to want ...
2
votes
1answer
123 views

Azure Resource Manager Security rules implementation with powershell

I've been trying to push Azure NetworkSecurityGroup rules through powershell. Using the console I seem to be able to create what I want, however using powershell I am having little success. Using ...
0
votes
1answer
74 views

linked mailbox ADSI Edit

I have a clean up task to do with my Exchange 2003/07 environment. The set-up is as follows: domain controllers - ( 2003, 2012, 2008) Domain Function Level is: Windows Server 2003 Server 2003, ...
0
votes
1answer
31 views

Pass arguements as parameter to -filterXPath get-wineventLogs

Hi I made powershell script in which I am taking three arguements(in param block) and passing them as parameters to -FilterXPath. But I am not able to get the result. $eventID=7036 $ServiceName=PW ...
0
votes
2answers
84 views

How do I query (uniquely) the current user's information from Active Directory?

How do I query the current user's information from Active Directory? I know that I can access a lot of information about the current user from Windows, such as environment variables and the like. I ...
0
votes
0answers
41 views

execute powershell script even if he is already running

I have a powershell script that is scheduled to run when an user account is disabled in Active Directory. My problem is that when i'll use a script in order to disable multiple user accounts (for ex. ...
0
votes
0answers
21 views

Needed permissions to read msDS-ReplLinkFailures attribute

I'm using powershell to get the value of msDS-ReplLinkFailures attribute like this: Get-ADRootDSE -Properties msDS-ReplLinkFailures This works ok if the current user is member of domain's ...
3
votes
2answers
52 views

How can I check group membership when an user account is deleted ?

I have a scheduled task which executes a PowerShell script when an user account is deleted from Active Directory. Is there a way to check the group membership of that user account ? I have tried with ...
0
votes
1answer
388 views

The server was unable to process the request due to an internal error with Powershell

The server was unable to process the request due to an internal error I ran into the below error message when running the Get-ADPrincipalGroupMembership account Powershell commands for certain user ...
0
votes
2answers
51 views

Powershell ForEach Loop spitting out badly formatted samAccountName

I am attempting to take a list of account names from a group and then create a file in each of their home directories. But the problem I run into is everytime instead of getting the account (e.g. j....
0
votes
0answers
88 views

Dynamics CRM: Get-CrmSetting SSL/TLS error

I am getting an error when trying to enable Tracing in one of our servers. Commands used: Add-PSSnapin Microsoft.Crm.PowerShell Get-CrmSetting TraceSettings Error: Get-CrmSetting : The ...
0
votes
0answers
126 views

How to send an email with Powershell that doesn't end up in spam folder to Gmail?

I have various PowerShell scripts on Windows Server 2012 R2 that I like to notify me via email upon completion, so I setup a local SMTP server that is restricted to 127.0.0.1 only, and use this ...
3
votes
1answer
50 views

Windows Server firewall track connection state

I am trying to control a Windows Server 2012 (R2) firewall by using PowerShell commands (see https://technet.microsoft.com/en-us/library/hh831755.aspx#BKMK_ProfileGlobalDefaults for example and ...
1
vote
1answer
95 views

Knife not parsing JSON variable in PowerShell

I am trying to create an amazon EC2 instance using "knife ec2 server create" and passing in JSON to override the default settings by using the -j option where $json is properly formed JSON text and I ...