Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Browsing all 8583 articles
Browse latest View live

Running PowerShell script as different user

HelloI need a way to run a PowerShell script as a different user (I do not mean RunAs Administrator)I see some examples of user Start-Process with the RunAS option but this is to RunAs Administrator as...

View Article


Report on folders displaying size but also other calculated values

Dear,I have a powershell script running, which returns me a proper report on the size of all subfolders of the homedirectories on our...

View Article


Comment base help is NOT working as expected.

I'm not getting the correct help info, when I do get-help. Using the below code.  I get some info (NAME, SYNTAX) etc. But I don't see SYNOPSIS & DESCRIPTION. What I'm I doing wrong?function...

View Article

copy file to multiple computers

Hiim trying to copy a file from one computer to multiple servers.I want to use a txt (Srvlist.txt) file containing the servers name.but I get an error that the path cannot be found.I can copy the file...

View Article

Help copy and remove item

Hello,Iall the filesin the source directoryand sub-directoriesdizinlerdrefiles fromtarget1andtarget2preservingthe directory structureyou wantto copyanddeletefiles that are copied.(Duringthe...

View Article


how to delete home folders via powershel

Hi everyoneHope you can help meI work for large firm and need to delete left users' home folders from all of the file servers and need to help to get it workingthis is what I have and I believe I still...

View Article

New-Item Cmdlet is breaking my script

I have a script that does the following:Check to see if the designated file backup location is online/present ... if NO... alert persons via e-mail ... if Yes, check to see if there are files in a...

View Article

open port 7 echo protocol on windows 7

Dear Sirs I'm trying to open port 7 for testing purpose using the following command$tcpClient = New-Object System.net.sockets.tcpclient$tcpClient.Connect("test-pc",7)but I'm receiving the following...

View Article


Backing up Hyper V VMs in PowerShell

I have researched this like crazy! And I can not get my script working to export VMs to a network location. Going through the GUI this works. I have no idea why this isn't working in my script. P.S. I...

View Article


I want to deploy/transfer a script on 20+ servers

Hi,I have a script that I would like to place/deploy into 20+ servers before I can execute it. Can someone help me I am completely clueless as to how to start it.

View Article

Moving computer to new OU

$Find = Get-ADComputer MG10011001Write-host $FindMove-ADObject $Find -TargetPath "OU=MGH_USERS,DC=Acme,DC=org" When I run the above code it completes without error but it does not move the machine....

View Article

find out how many objects i have in a var and members?

Hi all, not sure my terminology is 100% correct here so please tell me if im wrong.  Im hoping to create a dynamic script that will populate excel with the results of any query i run against sql.But im...

View Article

Reset Active Directory Users to Require Passwords

Q: I have some users who were configured in Active Directory to not require passwords. I need to reset their profiles to require passwords; how can I easily accomplish this?Read More

View Article


PowerShell User Group in Omaha Nebraska!

That’s right! We now have a PowerShell Users group in Omaha, Nebraska. Jacob Benson (Blog | Twitter) and myself are kicking off the inaugural session on 29 July @ 6:30 PM at the Microsoft office. If...

View Article

How to manage your servers remotely with PowerShell

Windows servers, remote management and scripting: What ties all of these things together? Powershell. You can use PowerShell to manage a local machine and a remote machine as well. Using WinRM (Windows...

View Article


Remotely Run PowerShell on a Cluster

Q: I'm trying to remotely run PowerShell commands on a node in a cluster, but the commands aren't working because of an authentication problem. Why?A: When a PowerShell command is executed on a remote...

View Article

Change below code run in one attempt.

My code at the moments runs through the security permissions checks on a computer and places the results in a specified folder. But how do I change it from looking at one folder to looking at 10+...

View Article


Change this code for better functionality

I would like to change the code below to running on multiple servers in one go so looping through all the servers and checking the permissions, then posting them to a central location on the same...

View Article

Getting Domain Using SamAccountName

Hi,If I have a users SamAccountName how can I look up their domain? Once I get their domain I can return results in the format of <Domain>\<SamAccountName>I already have the PowerShell...

View Article

Identifying all Forests on the Network

Hi,Is there a way to return all the forests on your network? I need to be able get the collection of forests and then then get all domains on each forest for some automation that I am trying to...

View Article
Browsing all 8583 articles
Browse latest View live