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

PowerShell logon script form oddities

I was recently asked to add some logic to our old vbs logon script, but since the old one had a lot of unused functions and needed a rewrite anyway I decided to try to rewrite it in PowerShell. Since I...

View Article


ConvertTo-HTML from log file

How can I convert a log file to HTML file without losing the format. I tried ConvertTo-HTML but it's not giving the desired output. I am not able to attach file to the post hence copied sample log...

View Article


Image may be NSFW.
Clik here to view.

strange results with $foreach.MoveNext()

Hello All Can someone please help me with the following question please. I am having a difficult time with $foreach.MoveNext() If I do this cls$numbers = 1..10 foreach ($number in $numbers) {if...

View Article

PowerShell v3.0 Export-Vm - no config.xml?

Problem: Running the "Export-VM -Name foo -Path D:\exports" command from the PowerShell v3.0 console does not produce a importable export.   The Config.XML file is missing. Context: Hyper-V Server 2012...

View Article

Check SQL Server Virtual Log Files Using PowerShell

In a previous tip on Monitor Your SQL Server Virtual Log Files with Policy Based Management, we have seen how we can use Policy Based Management to monitor the number of virtual log files (VLFs) in our...

View Article


How to Retrieve Uninstall Apps Remotely?

Hello there, I am a beginner at Powershell and I attempting to write a script to retrieve uninstall software. Here is what I have so far... CODE BEGINS...

View Article

Automating PowerShell Reports, Part 1

I want to take a short break from my in-depth look at PowerShell-based Active Directory (AD) query tools and show you how to put some of that query power to work in a concrete way. You've already seen...

View Article

Automating PowerShell Reports, Part 2

In “Automating PowerShell Reports, Part 1," I introduced one of my favorite PowerShell cmdlets, send-mailmessage. It's a flexible tool that's essentially a command-line SMTP client, allowing you to...

View Article


Polling performance monitor in a loop- all calls to get-counter following an...

I'm no expert in PS but I have found it very useful as glue logic to automate little things here and there.  Recently, someone asked me if there was an easy way to poll multiple servers in a load...

View Article


Modify exchange mailbox across domains

Our Exchange servers exist in our corporate domain (east.example.com), but at our site, the AD accounts exist in our domain (west.example.com).  Here is the command I am trying to run: get-mailbox...

View Article

a newbie asking for help

I am coming from another platform and another scripting language. I am 51 and do audio post production. Aside from getting the audio right, I need to manage files and folders. I need to create folders,...

View Article

limitations get-childitem or get-wmiobject

For quit some time I want to search very large fileservers in a cluster with filepaths that exceed 260 characters for certain file extension. I have tried get-childitem and -include -filter etc but it...

View Article

What's In Your Pipeline?

If you've been reading Prof. PowerShell for any length of time you realize how much importance I place on the PowerShell pipeline. It's what makes PowerShell such a magnificent automation engine, once...

View Article


2 Windows Server features worth a second look

Server Core and DirectAccess are underused by IT admins, but recent changes in Windows Server 2012 make them valuable. Read More

View Article

7 ways Windows Server 2012 pays for itself

These new and improved 'supersaver' features offer the biggest return on your Windows Server 2012 investment. Read More

View Article


How to pass a variable from ssis 2008 process task to a powershell v1.0 scripts

Hello All, I am very new to powershell as a etl developer.  I am trying to pass a file name stored as a variable in the ssis package to a "Process task" transformation.  The process task is to execute...

View Article

Need help using Exchange commands on Windows powershell in windows 8?

I am running powershell in windows 8.  Powershell came installed on the machine. I installed the Exchange Management tools on my machine.  I have my powershell profile configured to load "add-pssnapin...

View Article


Rename/Copy/Delete homefolders

Hi there, please help me out with two maintenance tasks. I need 2 powershell scripts that based on a set of users, looks up the user's homefolder on our file server, then copies the contents to a new...

View Article

Image may be NSFW.
Clik here to view.

Process element in list one by one?

Hello, I have got a script that I would like to use for removing directories where their modified date is older than x number of days.  I have managed to convert the DirectoryInfo object to a list of...

View Article

What it actually means? ($user in $users)

1- Import-Module activedirectory 2- $users =Import-Csv 'C:\Testuser.csv' 3- Foreach ($user in $users) { 4- $filter = "name -like '$($user.name)'" 5- $pwd = ConvertTo-SecureString "$($user.pwd)"...

View Article
Browsing all 8583 articles
Browse latest View live