Quantcast
Channel: Windows PowerShell forum
Browsing all 21975 articles
Browse latest View live

How to start job for each server in my task and result should be saved in...

I have collected server name details from one odata source using powershell script and now I have the result  list and it contains 1000 servers.  After collecting the server name list I want to connect...

View Article


build array within scriptblock and use outside the block

Hi, I am using scriptblock to run several commands in parallel. The code working fine. BUT I am trying to build an array of object within the scriptblock. My aim is to have all execution results in one...

View Article


Help with script

Hey, I have a script that I can't seem to figure out how to write correctly. What I want to do is to add domain accounts to local groups on either a local or remote computer. I want to be able to add...

View Article

Working with ExtensionData attribute (byte arrays)

Hello all,I am working with the ExtensionData attribute in PowerShell, which is in byte array form. What I am wanting to do is change a part of this ExtensionData attribute, but still keep the byte...

View Article

How Do I Edit a Text File in PowerShell??

How do i edit the text (or paragraphs) in text files using PowerShell?Thak You

View Article


Not able to install "Windows Management Framework 5.0" in WIndows 2012 R2

Not able to install "Windows Management Framework 5.0" in WIndows 2012 R2. Mentioned the error. Log Name:      Setup Source:        Microsoft-Windows-WUSA Date:          5/23/2014 2:43:56 PM Event ID:...

View Article

Cant return string for msExchMailboxGUID

Hi All,I am trying to get users msExchMailboxGUID as a string using the function below, however the msExchMailboxGUID is being returned as System.Byte[]. Any idea how to get this to display as a...

View Article

Drive Optimization -- Setting the frequency

Ok,I have been searching for a way to set the scheduled optimization of a drive to Daily, vs the default weekly.I would like to do this via powershell, so ican ensure that all my Servers are...

View Article


Setting environment variables remotely doesn't work for Windows 7

Hi,$RemoteMachineList = 'machA', 'machB' $session = New-PSSession $RemoteMachineList Invoke-Command -Session $session {[Environment]::SetEnvironmentVariable("Role",0,"Machine")}The above is the code...

View Article


How to set Write permission on a folder for Everyone using Powershell

I am trying to Share a folder with everyone and using the below command but it is not working,it shows that FOlder shared successfully NET SHARE Folder=C:\foldername "/GRANT:Everyone,FULL" Can anyone...

View Article

Image may be NSFW.
Clik here to view.

No line breaks in Send-MailMessage body

Maybe someone will be able to point out what I am missing here.I am trying to set up a task to send me a DFSR backlog report.  Nothing complex.  I have 4 groups and I just want the 4 lines below sent...

View Article

How to set Write permission for Everyone using Powershell

I am trying to Share a folder with everyone and using the below command but it is not working,it shows that FOlder shared successfully NET SHARE Folder=C:\foldername "/GRANT:Everyone,FULL" Can anyone...

View Article

SQLPS used to work before sql update

I have a few .ps1 files being called from sql jobs that used to work and now i'm getting an error when the SQLPS module tries to load. The error specifically says: "...job step recieved an error at...

View Article


"Start In" Argument in powershell when running a .exe?

Trying to run a script(that runs an .exe) that looks a bit like this : Invoke-Command -ComputerName $Server -ScriptBlock {$command}I am trying to make it start from a specified path (right click an exe...

View Article

Select-String output help

Hi I need to get some information from a .txt file and out put that to a .CSV file.So here is an example of what I use to do this$GetInfo = gc "c:\temp\MyResults.txt" | Select-String -Pattern...

View Article


Image may be NSFW.
Clik here to view.

Error cannot load windows powershell snap-in coexistance-configuration -...

Hi I have a powershell script on Windows Server 2008 R2 that will force the directory synchronization. I am trying to run C:\Program Files\Windows Azure Active Directory Sync\DirSyncConfigShell.psc1...

View Article

OS caption equals: Why...does this not work?

I want to use GWMI to get OS and then branch accordingly.  Why does the following not work?$gOS = gwmi win32_operatingsystem$gOS.caption.equals("Microsoft Windows 7 Enterprise")I get false as a result....

View Article


Powershell file manipulation

Yet another one of these things we do .VBS without a hitch, but I (and others in my team) can't wrap our heads around how to do it in Powershell, so instead of wasting countless man-hours on this, I...

View Article

Powershell error: The Remote Procedure Call Failed

Hi,I created a c# executable that calls a powershell cmdlet through powershell.invoke(). The method returns an error "The Remote Procedure Call Failed". However the commandline string for the cmdlet...

View Article

when process reach high cpu kill it and start a service automatically

Hi allim new to powershell and i need help for a script that i need that will do the following:when process reach high CPU  kill it and start a service automatically. i created the following script...

View Article
Browsing all 21975 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>