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

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 ...
1
vote
2answers
34 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
1answer
28 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
42 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
25 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
33 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
39 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
15 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
16 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
0answers
33 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 ...
-4
votes
0answers
22 views

Is there a powershell script to apply custom settings in IIS to multiple web servers? [on hold]

Wondering if there is a ps script available to apply custom settings in IIS multiple servers at once ?
0
votes
0answers
28 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
24 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
29 views

Powershell script, GPO logon script for homedrive

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
19 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
11 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
33 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
17 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
15 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
70 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
25 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
38 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, ...
1
vote
0answers
38 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
22 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
1answer
49 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
31 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
42 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
25 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
20 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
43 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
0answers
30 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
40 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
48 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
28 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 ...
0
votes
1answer
34 views

Change passwords for schedule Tasks Daily

I need to schedule a health check script on a particular domain controller , have the service account, everything works. Unfortunately due to firewalls, this script can only be run on a DC, which ...
0
votes
0answers
7 views

Why does Read-SCVMHost fail when an unrelated host cannot be read?

In SCVMM 2012 R2 Rollup 7, I had an issue with a certain Hyper-V host (host1) which was on a cluster with another host (host2). When running Read-SCVMHost -VMHost host2, the command failed with the ...
2
votes
1answer
90 views

instanceType attribute in Active Directory

I need to change the instanceType attribute of a service account. If I try to change it from Active Directory Users and Computers console it's greyed out and if I try to change it via powershell with ...
2
votes
1answer
49 views

Use Windows PowerShell to find and delete files from specific owner

Because of a ransomware attack (no big deal, all recovered from backup) I want to clean up the directories and sub directories on the network share where the attack happened to create a lot of ...
0
votes
0answers
16 views

powershell select previous days IIS log file

I am trying to select the IIS log file from the previous day to search it. The command I am trying to use to select the set the date format so I can then select the file is: (get-date).addDays(-1) ...
1
vote
1answer
62 views

Wevtutil equivalent for powershell script to get event logs

I have made a powershell script which is as below but since I won't be able to save it in .evtx format. I want the wevtutil equivalent(using wevtutil epl) for the same.Please help! ...
1
vote
1answer
27 views

The term 'New-RemoteMailbox' is not recognized as the name of a cmdlet

Trying to create the new remote mailbox for O365 (on-premis mailox does not exists). I'm establishing connection to local Exchange server (either by EMS or by Invoke-Command PowerShell) and try to ...
1
vote
1answer
42 views

PowerShell - Set-RemoteMailbox to move to Office365 - object couldn't be found

I'm trying to create an online mailbox for existing Exchange 2010 user. This user is present in AD for sure. To do this I'm trying to use command like: Set-RemoteMailbox 'userE-mail' Though, I'm ...
0
votes
4answers
60 views

Azure : Script to start or shut down multiple VMs

Is it possible to write and save some kind of script that launches azure powershell, then authenticate azure subscription then start/shutdown multiple VMs in one step? I have 5 VMs that I use ...
1
vote
1answer
35 views

WMIC Command works, but doesn't work in powershell script

#Get Data Rate wmic "/OUTPUT:'C:\Users\user\Documents\DATE RATE\Data_Rate-ts8"+".txt" nic where 'NetEnabled = True' 'get Name,MacAddress,Speed'" Running this in the console directly works. That is ...
0
votes
0answers
18 views

Get-BPAModel returns index was outside the bounds of the array

Have an issue running BPA scans on Server 2012 R2 from server manager, task would fail (BPA scan did not complete) but refreshing the BPA view would yield completed scans nonetheless (for ...
1
vote
2answers
45 views

How to get Ad Domain name in my forest

I have a big forest with many AD Domain, and frequently add new domains. I need a list of these Ad Domain to query each DC.
0
votes
1answer
101 views

Windows Server 2008 R2 Task Scheduler Powershell issue

I am trying to schedule a task which runs a powershell script. This script copy several files from one server to the one which the script is running. If i run the script with an elevated powershell ...