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

Script to retrieve Database name and creation date

Hi,I have written the following script:foreach ($Server in get-content "D:\Servers.txt")    {    #Retrieve Database list    Invoke-Sqlcmd -query "select name ,create_date from sys.databases"...

View Article


GetaA XML String from a XML file

Hey,i have an XML file<XML><item><Name>Stefan</Name></item></XML>For this XML file i build the PowerShell Script[xml]$XMLFile = get-content "XML File"Write-Host...

View Article


find missing files that are out of sequences

I have a folder with files that are being sent to me daily for updating a system.These fiels have the format DATA????.EX_there ? is a numbere.g.DATA0001.EX_DATA0002.EX_etc.Becasue I have 67 folders...

View Article

Logfile check timestamp

I am trying to grab timestamps from a logfile to check if the process writing to the file is active and updating the file.The file looks something like this and a timestamp is being generated in the...

View Article

Getting RANDOM errors while loading...

Hi, I'm trying to convert a .doc to HTML, and for that I do $saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat], "wdFormatFilteredHTML"); at some point in the script. When using...

View Article


SMTP relay list import

I have a requirement to populate over 100 ip addresses into the IIS6 SMTP relay as "grant". What I would like to automate is the following:foreach (server in list of IP addresses) {import each IP...

View Article

Script to Find and Replace a line of text, then output the lines changed to a...

I'm looking for a script that will do the following:Open a txt fileLook for a piece of text, then replace it with another piece of textSave the txt fileOutput the changes (possibly line numbers as...

View Article

Use .doc file as email's body

Hi,I'm trying to send an email via the Outlook com object, but I can't figure out a way to use a .doc file's content as the body of the email.I found a way to convert the .doc to .html, then use that...

View Article


How to Create a PowerShell Profile

PowerShell is a great way to automate almost anything in Windows. However, its not just a scripting language. If you find yourself using it as a command line shell it may be useful to store your...

View Article


Monitoring XenDesktop Power Actions using the Powershell SDK

 I was working on a script last night to help track power actions in a 10K+ machine environment, and felt compelled to share some scripts I put together to track power actions in a XenDesktop 5.x...

View Article

Top 10 Reasons Not to Fear PowerShell 3.0 for Windows Server 2012

Fear not, there are really only three things you NEED to REMEMBER about PowerShell.  However we did not want to stop there.  In this video Blain Barton Interviews PowerShell scripting book authors and...

View Article

how to get a content of a file to event log

I have got PS script to get the Regkey count to a text file. I am using this script in Task Scheduler & Can you please let me know if we can get the content of that file and have that logged to...

View Article

How to output to csv file?

The following script i am trying to output to csv file.  I have tried for a few mins to find out how but keep getting it to fail or not work.  New To Powershell and trying to learn$strCategory =...

View Article


Get a list AD users that have logged onto a computer

I am looking for a way to get a list of AD users that have logged onto a more or less public computer.  I can get all the local users, but not AD\users.I have not found any references and have no idea...

View Article

Reading Windows Script Host PopUp Window Content

Hello, I would like to write a script that looks for any Windows Script Host popup error windows, and can read the content. For example if the popup says:Script: C:\Scripts\Error.vbsLine:    3Char:...

View Article


Examples of IIS Powershell cmdlets

Summary:This document explains how to specify the values of parameter values and how the configuration file is updated by IIS Powershell generic cmdlets such as Get-WebConfiguration and...

View Article

Read Logfile with Servername

Hello,I´m new in Powershell World and I need one Script. I think script is simple but I´m don´t now how, following challenge: I have one Folder "C:\Logfiles" they contains Serverlogfiles like...

View Article


What PowerShell can do for SMBs

Thomas Lee reveals how Microsoft’s PowerShell can automate the tedious tasks carried out by IT administratorsRead more 

View Article

Manage your Windows Azure with PowerShell

Recently, I’m getting a lot of questions about automated scripting capabilities of Windows Azure. Although you can manage your cloud services with Windows Azure Management Portal a lot of scenarios may...

View Article

Playing around with [asdisearcher]

Hello All,I am leanring PosH at the moment, I was playing around with [ADSISEACHER] and have a couple of question please :)If I do this.([adsisearcher]"CN=Brant, Ernest").findone()I get basic...

View Article
Browsing all 8583 articles
Browse latest View live