Newest powershell Questions

Q&A for system and network administrators

Exporting and Importing Printer Settings using PowerShell

I am looking for a solution to export settings which were made on a specific printer which uses for example a "CAB A3 300DPI" Driver and import them afterwards on a diffrent device, which is using the ...

Remove a user from ACL completely using PowerShell

I wish to remove a user from folder permissions using PowerShell. I have found plenty of examples on how to remove the user permissions but I actually want to remove the user entirely. The equivalent ...

'Get-WBJob' and 'Get-WBSummary' unrecognised commands

I am using a script that is set to run every morning read if teh last backup failed or completed and then puts it into a html page. This works fine on all of our 2012/2012R2 servers using the Get-...

Get-ACL Set-ACL removes inherited groups

I'm trying to set folder rights for a group like this: \server\Share$\Folder1\Folder2 Traverse on Share$ -> Traverse Folder1 -> Modify Folder2 There are more folders in the share but the group ...

SMB file server on multiple network cards

We received two servers with hyper-V 2012R2 free for our project this week, and we need to create an SMB failover. I'm not familiar with multiple network card setups, as we had our previous servers ...

What are the differences between the available Office365 eDiscovery tools?

We are trying to script some eDiscovery tasks using PowerShell, and so far we have found the New-ComplianceSearch and New-MailboxSearch cmdlets. What are the differences between these two? Are there ...

Enable-PSRemoting or Set-WSManQuickConfig?

I'm getting pumped up for DSC and I want to cover my bases. I see that Enable-PSRemoting actually runs Set-WSManQuickConfig according to help documentation, I guess my main question is, what is the ...

Get SCCM site system servers associated with a boundary group

I want to get the site system servers associated with a boundary group in SSCM using Powershell. There is a commandlet Get-CMDistributionPoint however there is no parameter to specify a boundary ...

Enter-PSSession in a script doesn't do what I expect - it executes on local machine instead of remote

The "CD" command in script below executes on local machine instead of remote. What's wrong? Add-PSSnapin Windows.ServerBackup -ErrorAction SilentlyContinue set-item wsman:\localhost\Client\...

no access to powershell management shell (is powershell 5 the culprit?)

So the story so far : ever since a crash and restart of exchange 2013 (CU13) on windows server 2012 the management shell is acting up. I do all my echange administration via powershell and so it is a ...

How do you remove a web proxy from your config?

While looking for a solution to a problem, I added an InternetWebProxy to our Exchange server configuration: Set-ExchangeServer -Identity SBS -InternetWebProxy foo Now my proxy is set to foo, but ...

How do I amend the RoamingPreferredBandType property of my users' wireless network adapters?

We've been seeing intermittent issues with users connecting to wifi. It seems that this may be due to interference, with the recommended solution being to change the RoamingPreferredBandType to 5GHz. ...

Powershell: setting owner for AD DS objects fails

I want to run a Set-ACL on an AD DS object1 with "Domain Admins" set as the owner in my constructed ACL object. The code looks basically like this2: Function SetDSAcl { Param ( [...

Script to allow one user Reviewer calender permissions to many users (contained in security group)

I'm sure this is a simple query for people with Powershell skills, but I can't work it out. I'm trying to create a Powershell script that will allow one user reviewer permissions to a number of users ...

Set IIS website Classic ASP session timeout using Powershell

How do I set the Classic ASP Session timeout in IIS 8.5 using powershell? I've taken a look at using Set-WebConfigurationProperty but can't work out how to use it correctly.

“Permission Denied” creating a new domain-based Dfs root as non-Administrator

I have been tasked to delegate a number of everyday tasks in our domain to a group of technicians which does not have Domain Admins membership. One of these tasks is the creation of new domain-based ...

Editing local Windows Firewall Policy via Powershell

I'm writing a large script that goes through and applies a load of local policy settings via Powershell. Most of this is done by exporting the current security config via Secedit, passing this to an ...

Batch renaming folders in a directory [on hold]

I'm writing a script in powershell to organize media files in a directory and wrote this code to rename folders in the main directory "Season #". $i = 1 Get-ChildItem | ?{ $.PSIsContainer } | Rename-...

Windows scheduled task running slow

I have a script which among other things, updates a CName record in DNS. It updates the same record on multiple DNS servers, one at each site as we can't wait for replication. The first time the Get-...

Windows 2012 - Powershell v4 update hosts file without restarting

I wrote a Powershell script where I update hosts file at runtime: add entries, clear entries. An example of what I am doing: Import-Module 'Carbon' #Carbon module functions Reset-HostsFile #No ...

WMI object available through commandlet but not through Get-WmiObject

why can I get a WMI object using Get-CMBoundaryGroup, but not directly using Get-WmiObject? I get Invalid namespace "root\sms\site_CAS" when using Get-WmiObject $boundaryGroup1 = Get-CMBoundaryGroup -...

Where is the documentation for New-CMSoftwareUpdateDeploymentPackage

I've been googling and searching MS's website for their MSDN or technet page on this cmdlet and can't find it. Google keeps wanting to point to the Get cmdlet. I used the MS link for the Get: https:...

Office 365 Hybrid - Setting managment role for impersonation against OU?

I am trying to create an impersonation role for a service account and limit that to a scope of mailboxes rather than the entire exchange. However every article I come across either does not explain ...

Minimum delegation needed in AD for reading Scheduled tasks and Services info

I am trying to monitor Scheduled tasks and Services remotely(from a different domain) on windows servers (domain controllers) ; we are planning to implement a minimum required delegation model for ...

PowerShell Path Exception When Recursively Versioning Assemblies

I recently encountered a path exception in my PowerShell script in a routine that recursively searches directories for AssemblyInfo file to change versions. I saw a solution here: ...

Set credentials/password for remote connection in powershell on Windows Server 2012

I have 2 servers (both Windows Server 2012 R2). They both have an Administrator account with password xxx and the 2 servers are in the same network (domain). I didn't install/configure those servers. ...

What Security Implications Does WSMan “TrustedHosts” Have?

I found that WinRM requires TrustedHosts (in WSMan:\client) to be set to run remote PowerShell commands. I am unable to find official documentation on the security ramifications and risks of trusting ...

Read Gmail emails using Powershell [migrated]

We want to automate actions based on emails we receive by email from different management systems from devices in our network I have tried this small script, but it lists only the subject, not the ...

Start-BITSTransfer with network share as destination

I'm using Start-BITSTransfer to download a file from the internet and place it in a network location. The location is similar to \\computername\c$\folder which the cmdlet says it can't find and that ...

SCCM - PowerShell: All Systems collection not available

I try to import a computer to SCCM with the cmdlet "Import-CMComputerInformation" (https://technet.microsoft.com/en-us/library/jj821991(v=sc.20).aspx), using Import-CMComputerInformation -...

Unattended file is overriding pre staged domain joining options

I am adding automatically created virtual machines as pre staged devices on our WDS and giving them full join rights New-WdsClient -DeviceId $macAddress -DeviceName $name -BootImagePath "Boot\x64\...

Can I enforce a cipher suite with powershell

Can I enforce a cipher suite to be used when connecting to a TLS web site via a script. For monitoring and trouble shooting purposes, my goal is to create a powershell script that checks if a ...

Is there an easy way to alias PowerShell in cmd?

Whenever I login to my servercore server, the first thing i usually do is this: powershell start-process powershell -verb runas It's a little annoying to always write this whole sentence. can I ...

Made the mistake of installing W2016 core without gui need help installing gui

We just got our dedicated server from Rackspace. It was loaded with W2008 on it. I decided to put the most recent OS on it so I wouldn't have to upgrade it later. Apparently during the installation, I ...

How do you open a remote powershell session on an EC2 instance in a private subnet on AWS?

It's possible to open a remote powersheel session when the AWS instance has a public IP (http://stackoverflow.com/questions/21920773/execute-powershell-script-remotely-on-amazon-ec2-instance-from-my-...

Powershell: Disable need for elevation?

Is there any way to disable the need to run in an elevated context for a powershell script? Anything goes. I am setting up a test environment and during some of the tests I must reconfigure parts of ...

Need to force specified User to change password at next logon via powershell [on hold]

Is there any Script or Command to enforce specified user change his passoword next logon via PowerShell ? Please Explain Step by step. Tnx :) .

Why some servers fail when execute “Get-Service”?

I have several servers connected in VPN to my host server. All run windows 7. I'm running in loop Get-Service -ComputerName $server -Name Spooler for each server. For some reason some of them return ...

Powershell Script to write computer name and local printers to csv

I have searched and searched, but have had no luck finding what I am looking for. I want a script that will write the name of the computer and the local, not networked computers to a csv file. ...

IIS Manager Permissions - Rename-Computer - msdeploy

I rename my computername with the powershell command "Rename-Computer" after the reboot my deploying over msdeploy not longer working. I check the users and on this area the users have my old ...

Failed to using powershell to get cookies

I am writing a powershell script to mimic a login process,and then catch data from web pages. I failed at the very begainning, I can't get into the login pages at all after I set up cookies. Here is ...

Powershell send CTRL A

I am tryng to make a .bat in order to launch a program, and save the result as a txt file. The issue is in order to save you have to select some line so i would like to do a CTRL+A and a save as in ...

. .\Variables.ps1 returning CommandNotFound

I am trying to call a variable called $company from one powershell script called "Variables.ps1" into another powershell script in the same folder called "edit_website.ps1" at the top of "edit_website....

MSSQL proxy system permissions required to run PowerShell steps

I started to ask this on StackExchange DBA but decided it was probably going to be more of a Windows Server security type of question. SQL Server 2016 SP1+CU on Server 2012 R2. I'm trying to run a ...

String manipulation in the pipeline

I am looking at pulling out a portion of a property from within the pipeline, but I cannot seem to get it. If I was using ISE or a ps1 file, I could just manipulate as needed and output, but I need ...

Get-Item: Could not load file or assembly 'Microsoft.IIS.PowerShell.Framework'

I've been tasked with deploying Octopus Deploy to our development server infrastructure. It consists of 5 servers right now. Octopus Deploy Server, Web Server 1, Web Server 2, Web Server 3 and a ...

PowerShell, Exchange 2010 - comparing variable returns incorrect results

I'm having a problem comparing a variable. Can someone please enlighten me as to what I am doing wrong? "account.name" is the SamAccountName in this example. $DN = (Get-Mailbox account.name)....

directory service event log

Situation: I have a need to examine Directory Service event logs for multiple servers once an hour. In order to do this without crushing the DCs and not be bound by network speed I am copying the ...

Script to export many AD Groups' Properties/Attributes to csv

I have a list of about 1,000 Active Directory security groups (the list is in Excel, but I can save as csv or copy and paste into a txt file). I would use it to get the following properties/...

Install SCCM application to client via powershell, comand line or WMI

I am trying to create a script in powershell that request and install an available application for a user or computer in the sccm application catalog. I know that there is a way to force sccm client ...
Translating... 0%