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
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 ...
0
votes
1answer
240 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
310 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
39 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 isn'...
0
votes
0answers
34 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
147 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
104 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
19 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
180 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! $ErrorTime=Get-...
1
vote
1answer
166 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
244 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
433 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
101 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
44 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 fileservices)...
1
vote
2answers
67 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
136 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 ...
0
votes
1answer
265 views

How do I see why a Mailbox Export Request failed?

I'm trying to export a bunch of mailboxes to PST files and a few of the requests terminated early in a failure. A few 5GB+ mailboxes succeeded and a few really small ones failed, I can't see anything ...
2
votes
1answer
33 views

How to know the current script FullName [closed]

My script call many other script and i need know each fullname (for log info). but the same command doesn't work in Powershell_ISE
-2
votes
1answer
74 views

Active Directory/Exchange list users and mobile numbers

How can I use Active Directory Powershell or Exchange Management Shell to list all users and they're mobile numbers?
0
votes
3answers
74 views

powershell script to clean up ftp user folders

we have an ftp server with 50 users, they have a main folder(as below) and 5 sub folders. I am looking for a script that will clean the contents of the sub folders on a weekly basis. However not touch ...
0
votes
0answers
50 views

How do I perform a remote service stop and Postgresql backup using powershell?

I am having some difficulty with a Powershell script. The script runs nightly to perform a backup of a Postgresql db. I used WinRM to allow the server running the script to perform the service ...
0
votes
0answers
133 views

Cannot reset password on Azure Linux VM using Resource Manager (ARM) model

I have an Ubuntu VM setup under the Azure Resource Manager (ARM) model that, after an unexpected reboot, I have lost access to as the existing password magically stopped working. After trying to ...
0
votes
0answers
26 views

Using PowerShell Script to Connect to Multiple Azure Subscription and Delete Services

You cannot vote on your own post 0 I am looking for a PowerShell Script that will connect to multiple Azure subscriptions each with a unique login and password and delete all VNets, All VMs by using ...
1
vote
1answer
68 views

Cannot expand the folder

Boss wants access to all staff mailboxes (31 users). I've added full access permissions for each mailbox via powershell: Add-MailboxPermission -Identity "STAFF" -User" "BOSS" -AccessRights ...
1
vote
0answers
70 views

How to do I create linux VM with ssh public on azure automation

Right now, I am creating Linux VM without public key on azure automation. My aim is to create linux VM with ssh public key on azure automation. How to get ssh public key from "accets" on azure ...
1
vote
1answer
107 views

Add Startup and shutdown scripts to Local Group Policy using Powershell

I am trying to automate adding startup and shutdown scripts to Local Group Policy (gpedit.msc). One solution is to write to registry directly as pointed out in http://ccm.net/faq/3358-execute-a-script-...
1
vote
1answer
144 views

How can I use IIS administration commandlets on Windows Server 2012 R2?

I'm trying to use IIS administration commandlets such as Get-IISSite on a Windows Server 2012 R2 computer. I've already installed IIS Server and all IIS Management Tools roles and rebooted the ...
1
vote
1answer
792 views

Add-AzureAccount : unknown_user_type: Unknown User Type on azure automation

I am getting following error on azure automation when I trying to connect VM. Also follow this link http://stackoverflow.com/questions/29899964/azure-powershell-automation-no-default-subscritpion-has-...
2
votes
2answers
164 views

ICACLS in powershell script 50% working

I have an ICACLS command running within a powershell script. The script creates a new folder on a server share, creates a new security group in AD and then runs ICACLS to provision the folder. When I ...
0
votes
0answers
63 views

Deny a specific update in wsus, using powershell and his knowledge base code

does anyone know if and how in powershell you can deny wsus updates searching for the knowledge base code? for example: Get-WsusUpdate -kb kb3035583 | Deny-WsusUpdate
0
votes
2answers
51 views

Detailed Help for Azure Powershell Cmdlets v1.x

I'm running the following Azure powershell cmdlets: PS C:\> (Get-Module -Name Azure).Version Major Minor Build Revision ----- ----- ----- -------- 1 0 1 -1 PS C:\> $...
3
votes
1answer
104 views

Convert to HTML the output of Powershell

I have been working on a Powershell Script that generates email of the Windows backup event. The problem is the formatting looks bad. Subject: Computer name status [backup was successful] Tuesday, ...
0
votes
1answer
171 views

Sending a Maintenance Message to Citrix Xenapp Users via Powershell

I am trying to send a message to XenApp users via Powershell cmdlet send-xasessionmessage. The environment contains approx. 100 servers with 1000 active sessions. The script is very slow. When I test ...
3
votes
2answers
59 views

Rename VPN Connections via Powershell

I'm trying to batch rename vpn connections on my Windows 8.1 machine. I have no trouble modifying the server address with Set-VpnConnection, but I can't find a way to rename a vpn connection: First ...
3
votes
1answer
891 views

Azure Cmdlet Add-AzureRmAccount not working over corporate line

I'm currently learning how to create azure environments using powershell Resource Management cmdlets. The classic way of working had no problems, I could use Add-AzureAccount and it would allow me to ...
1
vote
2answers
222 views

how to access a unix machine from windows command prompt

I have created a Vyatta virtual machine on my Hyper-V server, but I didn't enable ssh on that virtual machine. I want to connect to that machine without enabling the ssh and execute some shell ...
3
votes
2answers
962 views

What's the difference between Get-AzureRmVM and Get-AzureVM

I'm trying to set up a Load Balancer on Azure. I'm following this doc. At the end, you basically have to attach your virtual network adapter to a running VM. The docs refer to using Get-AzureRmVM ...
1
vote
0answers
233 views

PowerShell: Populating TreeView with Directory Hierarchy

So I'm attempting to write a PowerShell script with a GUI input; idea being that the end users see a nested TreeView of the file system. They tick a some folders, hit a button, ...magic happens. I ...
1
vote
2answers
109 views

Creating valid mail enabled contacts without using Exchange specific cmdlets

I have written a powershell script to routinely process and import a large (over 70k) amount of contacts into an Exchange environment. The script works fine but I would like to speed it up if possible....
-4
votes
2answers
913 views

Modifying bulk user account attributes in AD

We created around 1,000 users but the first name, last name, display name, and logon name are all in uppercase. Now we are having a hard time changing all of these manually. Is there a way to we can ...
0
votes
1answer
714 views

Find out the name of all the servers a paticular account has logged or has a disconnected session on it

Hi We have around 400+ of servers and one domain + 3 sub domains, Whenever we change a password [Security reasons] the accounts keeps getting locked out as soon as we unlock it. So is there a way we ...
1
vote
3answers
476 views

Get installed programs via cmd or powershell [duplicate]

I am trying to get all installed apps in the computers of my domain but i haven't found a way to get the information in an accurate way first i was trying to achieve this through the registry key: ...
0
votes
1answer
154 views

File Server Resource Manager won't execute powershell scripts

Solution: Ended having to enable "Turn on Script Execution" in Group Policy. Located under Administrative Templates\Windows Components\Windows Powershell. Enable policy and set your desired execution ...
1
vote
1answer
187 views

How to modify Azure VM firewall rule for remote desktop

On an Azure VM I edited the Windows Firewall rule "RemoteDesktop-UserMode-In-TCP" so that only our Remote IP address was allowed access. In order to do this I also had to select General > Action > ...
0
votes
1answer
59 views

Difference between two powershell scripts

I received a script that is supposed to scan the event logs of 4 DCs, searching the event ID 4740 (user lockout). This is script number 1. Now I thought to myself, "Why scan all the DCs when I can ...
1
vote
1answer
224 views

Add 32-bit printer drivers to 64-bit windows server programmatically

GOAL: To install both x64 and x32 drivers for printers on a Windows 2012 R2 print server automatically. INFORMATION: So far, I've been able to install x64 print drivers with no problem. My attempt to ...
-3
votes
1answer
47 views

Export Mailbox to PST Every Month through PS [closed]

I have the following code which suppose to export previous 30 day mailbox from the current date. But it always exports complete mailbox, it ignores the content filter. $mailbox = "psingh" $FromDate =...
1
vote
0answers
32 views

Powershell Script to Automate Mailbox to PST

I have one script which is working though but I am not a advanced programmer. Please somebody modify my script as I wanted to ? 1) Mailboxes should be exported from specific server "ServerX". Right ...
0
votes
1answer
119 views

Powershell Delete list of files from directories located on a network share

I wrote the following script to delete all temp files and cached data from users profiles located on network share. It works fine when I run it locally on my machine but when I attempt to run it on ...
1
vote
1answer
143 views

Powershell to exclude Group Members from Dynamic Distribution List

I am attempting to remove specific users from a Dynamic Distribution List. I have searched and toyed with my PowerShell script for sometime with no luck. I'm sure it is something I am overlooking as I'...