SetAuditRuleProtection($False, $True) and Set-ACL
$acl = Get-ACL ...#do some stuff to the DACL#mark SACL to inherit audit$acl.SetAuditRuleProtection($False, $True)While this sequence of events will not break SACL inheritance, it will not restore SACL...
View ArticleHow to show Win32_classes properties
HelloWhen I do this in PowerShell:Get-WmiObject Win32_TCPIPPrinterPortor even: Get-WmiObject Win32_TCPIPPrinterPort | Format-List *it doesn't show anything. But if I put Get-WmiObject with another...
View ArticlePowershell foreach -parallel WMI query operation did not complete within the...
Hello!I'm running the following script in PS 3.0:Workflow Test-My-WF { $servers=Get-Content -Path "ser.txt" foreach -parallel ($server in $servers) { $proci = (Get-WmiObject win32_Processor...
View Articleemail trouble
have tried to answer many ads on crasigslist & ebay. when replying by email msn says email sent. also sometimes says problem sending email from my address. have never gotten reply from any ad-...
View Articleset-alias
Hello,What is wrong with the following code:Set-alias gs set-executionpolicy restrictedI want to set this line in my $profile but the line isnt working. I got the same problem when I want to use "cd"...
View ArticleConnect to Hotmail using Powershell
Folks,I have been trying to connect to Hotmail through Powershell. Can you offer any advice on how to accomplish thatThanks
View ArticleSimilar to connecting to remote computer using WSManagement, how to do it...
I have the following code to connect to the remote powershell and execute script on remote machine :WSManConnectionInfo connectionInfo =newWSManConnectionInfo(false,"MachineName",5985,"/wsman",...
View ArticleAzure AD Managment
Hi, I recently ran into the situation where we wanted to create multiple Azure AD's from a particular subscription. However, I quickly discovered there are no management options from within powershell....
View ArticleBypassing Execution Policy for a specific host
Is is possible to have the execution policy set to remotesigned but have specific hosts set to bypass? I am administering an SCCM 2012 environment and I want to be able to run Powershell to check for...
View ArticleRestart IIS remotely
Hi,I want to restart IIS service on a remote machine. What's the Powershell command for this, where I will be able to mention the remote server name, username, password?
View ArticleAD Module for Windows PowerShell - Insufficient Access Rights to perform the...
I have a recently upgraded domain that's now running all 2008R2 DCs. The domain functional level is 2008R2 and the forest functional level is 2003. I've also created a brand new lab domain with...
View ArticleHow do I search a spreadsheet for a list of URL's | then search those URL's...
Fist, I should mention I am not a programmer but am eagerly learning powershell!I am looking for an automated solution to accomplish what I am currently doing manually. I need a script that would...
View ArticleWmi class Win32_printer not found in root/cimv2
Hello all,I'm trying to use powershell to remove a local IP printer. I tried with this. The command ran successfully but did not remove my printer.remove-wmiobject -computername localhost -class...
View ArticleAdding Global Groups to Domain Local through script.
Hi, I have a script from creating Local Domain groups from Global Security groups, now I want to expand that script so it automatically adds that Global group to Domain Local group.Here is the script...
View ArticleRemove-ADGroupMember where member is in parent domain and group is in child...
I have a parent domain (sandbox.local) and a child domain (child.sandbox.local) and want the capability to add and remove sandbox\User to a (domain local) group in the child domain. I can add the user...
View ArticleThe term 'new-object' is not recognized as the name of a cmdlet, function,...
I have a script that runs well the vast majority of the time. On occasion I get an exception. I would appreciate any insight as to why it fails on occasion. I can't understand why the new-object...
View ArticlePowerShell Script Running Through Scheduler
Hi Folks,I am running below script to copy a file from one server to another server. This script uses it's own authentication.Issue is my security policy doesn't allow me to store password on task...
View ArticleUse Same Excel Object in Start-Job as Main PS1
I have hundreds of Excel files and one main file that has links to each of these files, but in order for the data to be pulled into the main excel file I need to have every file opened within the same...
View ArticleServer2012: Set-ClusterScheduledTask + "Run with highest Priviledges" - ???
Hey there,I'm trying to fix a script we have to trim VSS copies on our Fileserver which is a Serve 2012 Failover Cluster. This has worked in the past, however I think it got messed up when I changed...
View Article