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
0answers
11 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 + ...
1
vote
1answer
19 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
15 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
14 views

Exchange 2007 Management Shell 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
43 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 ...
1
vote
0answers
27 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!
1
vote
2answers
37 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
25 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
26 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? ...
1
vote
1answer
24 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
23 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
24 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: ...
0
votes
0answers
42 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
29 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
23 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
39 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
41 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
51 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} ...
1
vote
1answer
36 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
43 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`" ...
0
votes
1answer
45 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
0answers
18 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 ...
0
votes
0answers
23 views

why LINK HTTP request has bad response?

i uses powershell.my problem is in telnet.when i type below command it connects to google.com. telnet google.com 80 when it is connected i type GET,its response is normal return page source HTML ...
1
vote
1answer
48 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
29 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
1answer
26 views

Powershell script for SCVMM that queries VM's for name and removes the ones with a status of missing

I'm kind of new to powershell and I'm looking for a script that will help me find out what VM's have the name staging and to delete them if they have the status of missing. I know it should probably ...
-3
votes
0answers
30 views

Powershell script, GPO logon script for homedrive [closed]

I am trying to have this powershell script change the homedrive to H: and homepath to \server01\profiles\USERNAME. I have added this to a GPO so it executes upon logon, but Im not sure where in the ...
0
votes
0answers
21 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
12 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
38 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
20 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 ...
0
votes
0answers
20 views

PowerShell Set-WinSystemLocale cmdlet does not have any effect on system

I have to change system locale for several Windows Servers 2012 R2 from CLI, using winrm. OSs are installed from English media. I tried following these instructions describing the procedure in ...
4
votes
2answers
112 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
27 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
44 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
0answers
39 views

Launch remotely tests on multiple devices

Considering the following setup: 1 windows server 2008 (jenkins master installed on this machine) 30 devices: 10 with windows 7, 20 with windows XP We have to run some stress testing on these ...
0
votes
1answer
24 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
61 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
33 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
2answers
46 views

Unable to copy files via powershell cmdlet

I need to create script that will allow easy (one-click) file copying from server_a to server_b and then execute stored procedure via sqlcmd. Here's my code: $username = userdomain\username $password ...
0
votes
0answers
17 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
41 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
34 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
3answers
42 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. ...
0
votes
0answers
21 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
46 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
39 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
42 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 ...
0
votes
1answer
54 views

How to assign an IP for Hyper-V virtual machine using PowerShell?

I'm working with the Hyper-v and have created a VM using Vagrant. Seems to be in the Vagrantfile I've forgotten to define an IP address (static or dhcp use). Now I can view the info about the VM's ...
0
votes
0answers
35 views

Get-AzureService : ForbiddenError: The server failed to authenticate the request

I am using azure workflow on azure automation and get the template from Azure gallery for "connect the azure using subscription certificate". After Create the connection "Azurec" and upload the ...