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

Question on Inputs from .txt

Hi all, thanks for any help on this one, been scratching my head and google'ing but found nothing so far. (I'm new to powershell, so I might be looking in the wrong area)I have a normal .txt (no...

View Article


Computer Field Missing

The results file doesnt put the computer name from the list. How do I define it in my script? $strMachineName = import-csv C:\temp\PCS.csv$results=foreach ($line in $strMachineName) {     try {...

View Article


is it possible?

I want to create a directory with a .ps1 file and then copy the text of the file from the beginning and put it inside the created directory with a .ps1 extension. Something like...

View Article

Access Remotes Mapped Network Drive

I am working on a script that installs a .exe on to a remote computer. I have that working no problem. However, the program does not work correctly if I install the program directly off a file server....

View Article

Output name of file in Foreach-object command?

Good morning I feel like I've done all the most difficult bits of this so far, but am struggling with the basics :) I have a file with a date and time in seperate fields, I need to know how many rows...

View Article


Remote Registry

I am trying to start the remote registry service for each PC to fetch a value from the registry but going nowhere. $Computers = import-csv C:\temp\PCs.csv$results=foreach ($Computer in $Computers)...

View Article

replacing more than one character in a variable

Hi,  I would think there's a way to replace more than one character with one replace but cannot find an example anywhere. $str1='  A_PROCESS_DATE, ACOUNTRY)' I want to get rid of ',' ')' and multiple...

View Article

Lab Ops – PowerShell 4 and KPI

In a Remote Desktop Services lab setup involving a gateway to allow connections to our virtual desktops over the internet  we are going to need to use an SSL certificate to secure traffic between the...

View Article


Exchange Powershell Tip #07

How to set Event Logging Level (Diagnostic Logging) on all or filtered Exchange servers in bulk?Read More

View Article


#PSTip Filtering a collection using comparison operators

Starting with PowerShell 3.0, it is possible to filter a collection for matching or non-matching values using comparison operators. For example, assume that I have a collection with four elements in...

View Article

break big file into multiple files

I have a directory with several log files with content similar to the one below. I need to create a PS script that can extract contents from [BEGIN] to [END] section of the log file and put them into a...

View Article

DomainRole

Hello,I understand this script, only one thing I am interested in and not fully understood, that is "domainRole" property. How can I examine this property if I would like to know the meanings of the...

View Article

PowerShell PSDrive In

Here are a few tricks that you can use in conjunction with a PSDriveRead More

View Article


Dynamic Parameters in PowerShell

Has there ever been a time when you wanted to call a function or cmdlet with specific parameters that were based on conditional criteria that is provided? As an example: if a user requests your cmdlet,...

View Article

Create an Azure Image from an Existing Virtual Machine

Q: How can I create an Azure image from an existing IaaS virtual machine?A: You can use PowerShell to capture an existing virtual machine, including its entire disk configuration (i.e., if the machine...

View Article


Powershell Script. Where am I going wrong?

Hi folks,I am working on my first powershell script.  The goal of it is to parse a URI, pick-out all valid IP addresses, and write a UTF8 w/o BOM encoded file containing just the IP addresses to a...

View Article

Need help with regex

I have files with content similar to one below:SN1,Column2,Column3;SN2,Column2,Column3;SN3,Column2,Column3;SN1,Column2,Column3;SN2,Column2,Column3;I need to create a PS script which will perform some...

View Article


Call function from function

helloI am developping a function for create a generic Form. In this I handle callbacks i.e. some controls can have an associated function called when an event occurs.One script contains the form...

View Article

Powershell ACL Rights on Extraction of Creator Owner

Hello Guys.Any help would be appreciated.I've been assigned a task to extract the creator owner of shared folders on a window server 2003 platform.For days , i've been searching through the web...

View Article

Check for logged in user and log user in if not found?

Hi All, I'm new to this forum and new to powershell, so forgive me if any of this is redundant or not possible. We're in a situation where we have two applications that actually require the service...

View Article
Browsing all 8583 articles
Browse latest View live