Powershell and Scheduled task
I've a command file that starts a powershell script. This command works fine when I run it in a command box on a windows 2008 R2 server. I can see it because it create a log file.When I add this...
View ArticleMove and rename a lot of files
I need to do a daily sweep of a folder to see if any file(s) have been put into it. If there is a file I need to move it to another location and add the current date and time to the original file...
View ArticleMath or string wrong in script help!
The script below is suppose to query the recommended page file size and compare it to the current page file size. If I set the page file size it always says it is wrong because of the math in this...
View ArticleScript to Create OLEDB Connection
Need help in establishing OLEDB connection to the database, i am using the below script to connect to a oracle database, When i run the script the output is not showing all the records/ data. Enclosed...
View ArticleGet-Counter is not working on remote server with different credentials
Get-Counter is not working on remote server with different credentials.
View ArticleAdding to a CSV in a loop
I was trying to throw together a quick script earlier to watch the resource use of some IE instances on a machine. I needed the script to keep logging until I told it to stop. Rather than just...
View ArticleAnd a new member to an existent array
Good morning,Here i have a little script I wrote.cls$Date_Time = $(Get-Date -format g)$Computers = Import-csv "Computers.csv"$File = "Exported_File.csv"$report = @()foreach ($Computer in $Computers){...
View Articlepowershell script for assigning \changing ownership of a shared mailbox
Can someone please tell me shell script for assigning or changing ownership to a mailbox ?!I am new to powershell, I have to update ownership of 200 shared mailboxes and would really prefer to run a...
View ArticleAppending to a Displayname in Exchange 2007
I am trying to append ***Disabled*** to 387 user's Displayname using the import-csv command. The csv contains Displayname, Alias. Any idea on how i can script this so i don't have to do it individually?
View ArticleNeed help to Invoke complex cmd File on remote Computer
Hello,The Problem:In our Domain we use Matrix/Empirum to Deploy Software/Images/Patches etc.In the last 5 Month´something went wrong with the Inventory Function of the Program.To Force an Update of...
View ArticledestinguishedName
Ich search a possibility to extract only the OU part to the excel table. I usedName,@{name="OU";expression={($_.DistinguishedName -split",OU=")[1] How can I get all OU to different cells in a excelsheet?
View ArticleTrying to populate a CSV with drive info
Hi All - this seems so simple, but I cannot seem to get the output from this tiny script to show up in a CSV like it does on the host. I know I am looking at an output formatting issue, but that always...
View ArticleRestart server & then email
I am trying to write a script to restart a server and then email when the restart is done.I started with this basic command: Restart-Computer -ComputerName <string[ ]>,But I can't get it into a...
View ArticleQuery AD using Powershell for data in a csv file
Hi All, I am new to the Powershell. I have a csv file that has names of the users in it. I am working on a project and I need to have a script which can take input from this csv file and provide me the...
View Articlefilter the event message output
I have a small script below and need to know how to truncate the output of message field to show onlyNew Logon: Account NameNetwork Information: Source Network...
View ArticleParameterizing Scripts
I am just learning the art of "Tool Making" Don Jones book, chapter 4. I am posting this code for review and I hope it passes the formating industry standards, if not tell whats wrong and I will surely...
View ArticleFile migration
Hey all. I am looking to separate some files for a mail migration. We have several PST files per user that are grouped together in each user subfolder. We need to separate the PST files based on...
View Articlescript to unexpire user account and expire same day
Hi we have a group of user accounts that remain expired; if needed we would then set the "expires end of" attribute to today's date to enable it temporarily. Would like to set up a script that can...
View ArticleInstall software with powershell
Hi All,I am trying to build a script which would install some softwares one after the other. As the exe's cannot be tuned to use with powershell, I am using something like this, invoke-expression,...
View ArticlePowerShell - Email notification for failure of batch
Hi I am new to PS.I am executing SQL scripts via a batch file. PowerShell correctly exits the batch when a script fails. When that occurs I would like to send an email, or if no error occurs send...
View Article