Copy files to Remote computers using powershell

Hi SysAdmins

In an earlier post I described – How to copy files to domain member computers or servers using Group Policy Object (GPO).

In this post I will show how to copy files to remote computers or servers using a simple Powershell script and .txt file.

728x90_never-forget-password

All you need is:

A txt file that looks like this:

Server1.yourdomain.com
Server2.yourdomain.com
Server3.yourdomain.com
and so on…

You can use IP addresses as well.

And this piece of Powershell code:


$ServerList = Get-Content "C:\ServersList.txt" #Change this to location of servers list
$SourceFileLocation =  #For example: D:\FoldertoCopy\ or D:\file.txt
$Destination =  #Example: C$\temp

foreach ($_ in $ServerList)
 {Copy-Item $SourceFileLocation -Destination \\$_\$Destination -Recurse -PassThru}

Save the above code as CopyFilestoservers.ps1, and your servers list as ServersList.txt

You will need Write permissions on the remote machines to run the script successfully.

How to Install SCCM 2012 sp1

Hi SysAdmins

In this post I will go through the process of installing a SCCM 2012 sp1 server.

If you haven’t done so yet, please read my post about SCCM 2012 SP1 Installation Preparation.

This installation is good for lab or production environment.

We all know the power of Microsoft System Center Configuration Manager. Microsoft invested many efforts in this new edition of SCCM.

Forget about the old mmc 3 snap-in and get ready for a new experience and features.

In this tutorial I assume you already prepared the prerequisites for the installation.

Continue reading How to Install SCCM 2012 sp1

How to Retrieve a Password of an Application Pool User in IIS 6

Today I needed to set a SPN for a IIS application. I discovered that I lost the password of the user account which I need to configure on the application pool.

Luckily, there is a way to retrieve/decrypt the password if it is configured on an existing Application Pool.

This is done by using a Microsoft tool on the IIS server – adsutil.vbs.

Here are 5 simple steps to do this:

Continue reading How to Retrieve a Password of an Application Pool User in IIS 6

Create a Shortcut to Windows Explorer Objects Using CLSID

Hi SysAdmins

CLSID stands for Windows Class Identifiers, which are  long number that represents a unique id for an application component.

CLSIDs can be used to target application component without knowing their name.

If we want to create a shortcut to a location in a computer without stating its name, we can use CLSIDs.

Lets say that you want to set the windows explorer start-up folder in windows 7 to open up My Computer.

Continue reading Create a Shortcut to Windows Explorer Objects Using CLSID

The Silent Ping Command

The “Silent Ping” Command is a sort of improvement for the well known ping command.

So, why do we need it?

When you reboot a serve or PC remotely, you can never be sure when it was booted again or when it is online again,

Most people use the ping command with the -t parameter to check if a server is online again.

But what if you could know exactly when a server is up again or even simply monitor a server when it goes offline over the night,

Or if a communication error occurs that cause some kind of service outage.

Continue reading The Silent Ping Command

Create multiple site boundaries in sccm 2007

Hi Again

Recently I was puzzled by a tedious task. I needed to create 300+ site boundaries in SCCM 2007.

Obviously this task should be automated by some kind of a tool. but Microsoft doesn’t give such a tool.

So I searched the internet and found a nice script at this iste.

the script did not work at first so I modified it for my own needs to produce the needed result.

Continue reading Create multiple site boundaries in sccm 2007

How to copy new files to multiple computers using Group policy (GPO)

Did you Ever want to simply copy some files to your entire forest, domain or just a group of computers?

The easiest way, that is if your computers are in domain environment, is to use GPO – group policy object that runs a startup script.

There are lots of ways to make mistakes on this topic. So stay alert.

Continue reading How to copy new files to multiple computers using Group policy (GPO)

How to Add Hebrew to Powershell or Command (CMD) Console

Hi SysAdmins

Did you ever ran into a situation where you need to add a foreign language to the powershell or Command console? let’s say for script output purpose.

It seems that the process of adding Non-Latin characters is not widely documented.

In this example I will demonstrate how to add Hebrew writing to Powershell. This will also affect the Command (CMD) console.

Continue reading How to Add Hebrew to Powershell or Command (CMD) Console

How to find the system uptime in Windows XP/2003/Vista/2008

Hi SysAdmins

It is very useful to know how many days are your system up and online. Especialy in windows OS.

There are several ways to find the system uptime in Windows XP and above:

Using Systeminfo command:

This command-line utility shows the time that the system was booted and its running time.

Continue reading How to find the system uptime in Windows XP/2003/Vista/2008

A Place For IT System Administrators