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
53 views

Is it possible to add permissions to an Active Directory account using PowerShell?

We're deploying Active Directory, and we're using PowerShell scripts for most of it: creating the forest, creating AD elements (users, groups, sites, subnets), etc. We'd like to make some users able ...
2
votes
1answer
1k views

How do I configure permissions for a cluster share using Powershell on 2008?

I have a cluster resource of type "file share" but when I try to configure the "security" parameter I get the following error (excerpt): Set-ClusterParameter : Parameter 'security' does not exist on ...
2
votes
1answer
37 views

How to properly deploy internal self-signed scripts (Powershell)

Completely new to certificate usage so be gentle. I'd like to deploy Powershell scripts that I made to other employee computers so they can use them, but I will need to sign them in order for them to ...
0
votes
3answers
60 views

Security concerns with enabling PowerShell on a production server [closed]

I work in the software development side of an ISV. We're thinking of using PowerShell for some utilities in and around the core application (which itself is ASP.NET). One of my colleagues said to me ...
2
votes
1answer
245 views

Version v4.0.30319 of the .NET Framework is not installed and it is required to run version 3 of Windows PowerShell

I have a server which we are using for Batch processing. I can login to the server with svc_account and run powershell -f file.ps1 and it runs fine in either version 2 or 3 by the following - ...
0
votes
0answers
52 views

powershell command to get a list of all the snapshot in vmm (hyper-v)

i am using below script to get snapshot which are associated with my particular VM, but i am getting only recent snapshot information , can someone correct me in below script - $vmcheck = Get-VM ...
0
votes
1answer
20 views

Want to get checkpoint details for particular VM through “VMM PowerShell Script” activity

i have orchestrator with service manager installed . now i want to give facility to my developers to get checkpoint information about respective VMs (particular) from SMportal so that they can revert ...
3
votes
2answers
2k views

Using Powershell to update users home directory

I am trying to change the home directory path to a bunch of users. I wrote a script in Ppowershell which should change the path the username like so: \\serverName\shareName\$_.SamAccountName The ...
1
vote
1answer
46 views

Format-List in Powershell-Function not working

i want to use format-list inside a function in a powershell script to have some nice-formatted output. But when I use it, it simply doesn't print anything. In this thread the author had the same ...
2
votes
2answers
6k views

PowerShell - finding users who are Inactive AND not disabled

I wrote this cmdlet: Search-ADAccount -filter {(enabled -eq $true)} -Users Only -SearchBase "ou=FirstOU,dc=domain,dc=com" -AccountInactive -TimeSpan 30 But it outputs an error: Search-ADAccount : ...
4
votes
1answer
155 views

Bulk License Office 365 Users by OU with PowerShell

I'm trying to do something that I don't think should be too complicated of a fix. My end goal: I have certain users in one AD OU that need to use a certain license in Office 365, and different users ...
3
votes
2answers
92 views

Hyper-V guest loses network access when virtual switch port is in trunk mode

I have guest VM on a Windows Server 2012 R2 machine running Hyper-V. Currently, the guest is using the native vlan (vlan ID 1). I can communicate with the guest from the host and from the network. ...
3
votes
1answer
752 views

Strange format-list behavior in this PowerShell script

I have a weird behavior with format-list. When I paste the following code directly into the shell - everything works like a charm: @("Administrator","SomeUser","SomeOtherUser") |% { ...
0
votes
2answers
34 views

Powershell script failing when executed from Azure Site Recovery Plan

$username = "username" $password = convertto-securestring "*****" -asplaintext -force $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password ...
2
votes
2answers
115 views

Can I find the path to a DCOM application executable with WMI or Powershell?

I have installed (and registered) a DCOM application on a W2K8R2 machine, and its GUID can be found in the DCOM list shown by dcomcnfg. I can also use Powershell to find a Win32_DCOMApplication or ...
1
vote
0answers
122 views

enter-pssession : Connecting to remote server failed with the following error message : The user name or password is incorrect

I am unable to connect to domain controller via below script. This script is working for another domain controller so it mean script is correct. While I am connecting i am getting an error: ...
2
votes
1answer
146 views

How can I invoke a foreground process from a background PowerShell Job?

I'm working on a PowerShell script that provides console output and restarts the system several times during the script's operation. As soon as it starts, it registers itself as a Scheduled Job so ...
1
vote
1answer
41 views

Powershell remoting with active directory

I am able to connect to domain controller via below scrip remotely, but after that i want to run disable-ADAccount ,Get-ADUser command but I am getting error Get-ADUser : The server has rejected the ...
1
vote
1answer
62 views

Import IIS Advanced Logs into SQL

I'm using IIS 8.5 Advanced Logging and also logging some custom HTTP headers. How can I import the raw logs into SQL on a regular basis (i.e. every minute)? I want to avoid the overhead of ODBC ...
1
vote
1answer
427 views

How to give “only append” access to user in windows , for logging purposes

I have a powershell script which takes some data and dumps into a logfile whenever its executed.The script resides in single location and shortcut is distributed to all. I want to log the events on ...
4
votes
3answers
619 views

WinRM listener is not all ears

This is what happens when I try and connect to Powershell on my remote machine: PS C:\Users\Jonathan> Test-WSMan -ComputerName 54.228.XX.XX Test-WSMan : The WinRM client cannot complete the ...
7
votes
1answer
323 views

In what context do SCCM Powershell detection scripts run in?

I have finally had success using PowerShell detection scripts on clients with AllSigned execution policy. (hint: It started working after installing the latest service pack and using Adam Meltzer's ...
-1
votes
1answer
26 views

Apply group policy based on RDP Client O.S

I created a group policy to change the default shell, so that handheld PC can RDP to a Terminal Server and have the lob application kiosked. This work fine, but, sometime, is necessary to RDP with the ...
2
votes
4answers
6k views

How to avoid Remove-Item PowerShell errors “process cannot access the file”?

We are using TfsDeployer and PowerShell script to remove the folders ising Remove-Item before deployment of a new version. Sometimes the PS script failed with the error Remove-Item : Cannot remove ...
0
votes
1answer
58 views

Exchange Powershell Export to pst size

I'm using exchange powershell to export exchange mailbox to pst. I'm using this command: New-MailboxExportRequest -Mailbox user -FilePath [path] This works but one user was 30GB and each ...
0
votes
0answers
83 views

Copy files to “default” location using UNC path

When I log in remotely using PowerShell, I'm placed in a default location: > Enter-PSSession SERVER [SERVER]: PS C:\Users\smithe\Documents> I'd like to copy a folder recursively to this ...
14
votes
3answers
12k views

Can Remote Desktop Services be deployed and administered by PowerShell alone, without a Domain in WIndows Server 2012 and 2012 R2?

Windows Server 2008 R2 allowed deployment of Terminal Server (Remote Desktop Services) without a domain, and without any insistence on domains. This was very useful, especially for standalone virtual ...
0
votes
3answers
526 views

Powershell script to change local admin password

I have a script that I am using to change the local admin password from Microsoft. https://support.microsoft.com/en-us/kb/2962486?wa=wsignin1.0 is where I found it. Here is the script for anyone too ...
1
vote
0answers
79 views

Windows 2012 Post-sysprep Powershell script not running

I have 2 templates 1 x Windows 2008 R2 1 x Windows 2012 R2 I have sysprep'ed both templates, Generalize / shutdown, etc, etc On both templates have I the following post-sysprep script that should ...
1
vote
2answers
2k views

How do I make ncat not send a line-feed?

I'm on Windows 7 Powershell and have ncat from http://nmap.org/ncat/ I'm trying to send "foo" to some network device PS> ncat -u 192.168.1.255 6061 foo but it sends "foo\n" (66 6f 6f 0a) and ...
1
vote
0answers
217 views

“Please Wait” When running startup script, only on Windows 8.1

I have a startup script and I have been testing it on 3 different virtual machines. These machines are running different versions of Windows(7, 8, and 8.1). They all have the same Group Policy applied ...
2
votes
1answer
93 views

-ErrorAction SilentlyContinue not working

I'm working with powershell I'm calling a script from c#. I'm trying to copy logs from different servers, foreach($server in $args) { $destination = "\\$server\$path" if(!(Test-Path ...
1
vote
3answers
3k views

Missing something when adding AD users with powershell

I'm going round in circles and hoping someone can point me in the right direction... I have created a .csv file as follows SamAccountName,Name,GivenName,Surname,DisplayName,Type,Path,Logon ...
1
vote
1answer
42 views

Test impact of DSC script using vNext in Release Management

Following the examples on the web, it's not hard to set up a working example for the first DSC script. However, I need to find a way to just list the changes that the script will make, not actually ...
1
vote
1answer
47 views

What's the “supported” way of using Exchange PowerShell cmdlets in a script?

From what I've read, Microsoft doesn't support using the Exchange PowerShell cmdlets from anywhere but the Exchange Management Shell. However, surely people need the ability to script things and run ...
11
votes
1answer
264 views

Windows Remote Management Over Untrusted Domains

I am currently trying to enable Windows Remote Management (specifically, Powershell Remoting) between 2 untrusted domains, and having no luck. A brief description of my setup: domain1 - my ...
0
votes
0answers
53 views

How to refer to office365 user using Set-Mailbox in Powershell

I'm trying to change a user mailbox to a room mailbox in powershell. I know the basic command is: Set-Mailbox "John" -Type Room When I try to run this, I keep getting an error that says the object ...
1
vote
1answer
23 views

Test if PowerShell script being called with Invoke-Expression?

Is there a way to tell if a script is being called using Invoke-Expression rather than called directly? I want to do something different, e.g. pause for input, if the script is being called directly ...
0
votes
0answers
110 views

How do I troubleshoot “Failed to get staged packages for package” error when attempting to remove a provisioned app from an offline Windows 8.1 image?

When I attempt to remove provisioned apps from an offline Windows 8.1 image, most of the apps I want to remove cause no problem, but attempting to remove Microsoft.Office.OneNote causes an error. The ...
1
vote
1answer
30 views

Powershell to non-domain machine

I'm writing a small script that needs at one point to connect to a machine that is not a domain member. The machine the script is run from will always be a domain member. I've found that using the ...
2
votes
1answer
81 views

Set-NetFirewallRule alternative in Windows Server 2008

I am trying to Enable Powershell Remoting on a Windows Server 2008, but from what I understand, the default firewall exception is that PSRemoting is only allowed if the computer (both client and ...
0
votes
2answers
132 views

powershell change filename using first 10 characters and mask

This script was working fine for a while but I have found that users don't always comply with the correct naming conventions for it to be effective. I have been banging my head trying to modify it but ...
4
votes
2answers
3k views

What version of Windows Management Framework is installed?

How do you check to see what version of Windows Management Framework (WMF) is installed? It seems like it should be a simple thing to find out, but I cannot. Even Googling a bunch of different ...
0
votes
0answers
126 views

ERROR: OpenSSL::PKey::RSAError: data is too large for key size", when trying to upload cookbook 'learn_chef_iis'

I am receiving the following error message: "ERROR: OpenSSL::PKey::RSAError: data is too large for key size", when trying to upload cookbook 'learn_chef_iis'. I was following a CHEF tutorial and now I ...
0
votes
2answers
1k views

Set group permission on folder

I have a folder with lots of subfolders D:\Data\Subfolder1 D:\Data\Subfolder2 D:\Data\Subfolder3 D:\Data\Subfolder4 D:\Data\Subfolder5 ... I need to create three active directory groups ...
2
votes
1answer
76 views

How to combine two foreach loops?

I've looked at how to combine multiple commands with psexec but none of the methods seems to work. Maybe it's because I'm running the script in PowerShell and not cmd.exe? I need to create user ...
3
votes
2answers
92 views

How can I retrieve a domain computer's details from AWS Directory Service?

I know using the AD module for powershell that we can retrieve domain computers details and export them as csv. My domain is in AWS Directory Service, and I have a computer under this domain. I tried ...
0
votes
1answer
74 views

What permission is needed to use a service account to remote run powershell on a server?

I have a internal webapplication With a list of all the servers in our network. I want to be able to run a few PowerShell commands on the servers to gather usefull information. Invoke-WMIMethod and ...
1
vote
2answers
171 views

Retrieve internet proxy server address via PowerShell

I have to retrieve the proxy server address and port via PowerShell, so I can use the Invoke-Webrequest -uri http://some-site.com -Proxy command. The expected output should looks like ...
1
vote
1answer
315 views

Scheduled task deployed via GP, that runs a powershell script on a network share by a AD service account

I've created a powershell script that runs Chocolatey updates as well as does some logging locally and on a network share. The script itself resides on a network share, and I'm hoping to be able to ...