New powershell script. Goes to user home directory on remote server and dumps the folder names to a file. Then, goes through each line in that file and queries AD to make sure the user still exists and outputs it to the console. Not finished yet. Previous admins weren’t keeping up with deleting the home […]
Archive for the 'Uncategorized' Category
Query AD from file generated by user home directories stored on file server
Published March 1st, 2010 in Uncategorized. 1 CommentPowershell Script to delete files older than 2 days
Published June 17th, 2009 in Uncategorized. 1 Comment$DataFolder = “c:\scandocs”
$2Days = (get-Date).adddays(-2)
Get-Childitem $DataFolder -recurse | ?{!$_.PSIsContainer -and ($_.LastWriteTime -lt (get-Date).adddays(-2))} | remove-item -whatif -force
I started looking around and found this script to email via vbscript. Later I’ll include different things you can email yourself if you’re an system administrator.
strSender = “sender_email”
strRecipient = “recipiente_email”
strSubject = “Subjet String”
strMessage = “Message String”
strcdoSendUsingPort = “2″
strMailServer = “smtp server”
strMailPort = “25″
Set objEmail = CreateObject(”CDO.Message”)
objEmail.From = strSender
objEmail.To = strRecipient
objEmail.Subject = strSubject
objEmail.TextBody = strMessage
objEmail.Configuration.Fields.Item _
(”http://schemas.microsoft.com/cdo/configuration/sendusing“) […]
This script will connect to a computer remotely and get the updates installed along with date and domain info. I haven’t formatted the script correctly for display on the web so you might have to do some editing. The script will put the info in a csv file. This script was written with help from others […]
This script will connect remotely to computers listed in a text file and inventory the computer processor, memory, IP, and Hard drive space. The portion that inventorys the hard drive space was written by some else and the rest I got it from MS website along with other sites. This script will dump the info to […]
I began scripting a couple of months ago and wrote this script to inventory the version of norton installed on client computers. In my enviroment I simply export the computer accounts to a text file and run this script. As I get better with vbscript I’ll be able to connect directly to AD. It could […]
