Quantcast
Channel: Windows PowerShell forum
Browsing all 21975 articles
Browse latest View live

Get the largest video files except few directories

Hello everyone,I am writting a script to get the largest video files on network, except few directories. I have a problem with Get-ChildItem cmd let. I am using include and exclude in pipe and it won't...

View Article


Security problems with executing powershell script with Windows 8

Hello,I have a problem with executing a  Powershell script on Windows 8 that is executing fine on Windows 7.The script does the following: 1) Applies a snapshot on a vm in Hyper-V and starts the vm; 2)...

View Article


Image may be NSFW.
Clik here to view.

Windows Powershell 3.0 get/set Single A record From group of same name A...

hi there, i made a program about a mounth ago which updated my A Records for my DNS server, this was great as at the time i only had one DNS server, and had a DYnamic IPv4 public adresshowever i now...

View Article

Limit running time for a function?

Hi. I am trying to create a Powershell Form application for fun. It seems like most things are working as they should, but I am struggeling to find out how I can set a time-limit for my function to...

View Article

Read-Host Default statement

So my script looks like this1$UserIopsIntervalInput = Read-Host "(IOPS - sample interval), How often do you want a sample taken (in seconds, default is 1)" 2$UserIopsPeriodInput = Read-Host "(IOPS -...

View Article


Export-CSV does not place the data into seperate columns

Hi Gurus,I am trying to create an inventory from my environement. If I run the following command it doesn't save the data into seperate columns. As a result I don't have the option to filter the...

View Article

set .sql file as variable

I have a powershell script where I set the variable based on a query like this: $Query = "SELECT t1.BSM_NM ,t1.D_DTM AS MAXDATETIME ,CASE WHEN SUM(t1.V_CUST_BLK_CNT)/SUM(t1.V_ATT_CNT) >=...

View Article

enable/disable outlook rule

Is there a way to enable/disable a local client outlook rule through powershell?

View Article


Image may be NSFW.
Clik here to view.

Changing .Value To.MB

I am running the following query but I'm not able to convert the value to MB ,@{Label="Test";Expression={$_.ProhibitSendQuota.Value.ToMB()}}Not sure what I'm doing wrong, the attribute is...

View Article


Any way to run a powershell script in a directory with spaces in it, just by...

Hello,Is there anyway to run a powershell script in a  directory with spaces in it, just by doubleclicking on it?For example I browse to c:\my folder with explorer and click on myscript.ps1, it won't...

View Article

Problem creating OUs with Powershell

Hello Everyone:I could use a bit of a hand: I am trying to automate the process of OU creation using Powershell.Problem: I am able to create a base OU named Managed Objects and place a sub OU under...

View Article

Powershell Script Quest One Snap-in Slow When Not Logged Into Domain

I have a powershell script that uses the Quest One ActiveRoles Management Shell for Active Directory snap-in.  Scenario 1When I'm in the office, the script runs very quickly (1 min).  No...

View Article

How can I combine this query?

$Username = Read-Host "Username" Write-Host "Searching Domain Controllers..." $DomainControllers = Get-ADDomainController -Filter * ForEach($Controller in $DomainControllers) { Get-ADUser -Identity...

View Article


wmi filter only works when negated twice

Has anyone ever saw this before and/or do they know whats causing it?  When i try to run the query with the filter of 10.1.% it doesn't return anything.  But when I negate the filter twice, I am...

View Article

How to know when an install is done installing

I am trying to install a patch via powershell but i cant figure out how to know when it is done installing.Powershell returns before it is done installing. What i think is happening is when i call the...

View Article


Importing from csv and Exporting to csv in Powershell to query AD

Hi,Here's the story, i have a csv file that has close to 10000+ users listed in AD. The csv file has their name and title. (EX: Doe John, Manager)I'm trying to see if it's possible to query AD for the...

View Article

Remoting issues

Very new to powershell here........I've got a script that I've pieced together to remove and reinstall java.  The script runs fine locally, runs fine when I enter-pssession on a remote workstation and...

View Article


Image may be NSFW.
Clik here to view.

reading multiple row lines from query in power shell.

I currently have a powershell script that returns one row of data, the script goes like this: $Query = "SELECT t1.BSM_NM ,t1.D_DTM AS MAXDATETIME ,CASE WHEN SUM(t1.V_CUST_BLK_CNT)/SUM(t1.V_ATT_CNT)...

View Article

How to Set-Timeout for the Cmdlet "Get-Service"

Hi Team,I am Running an Script for Filling some of our Automation Need, One Part of the Script Code Use the Get-Service Cmdlet to fetch the data  if the necessary Service is installed on the Target...

View Article

Windows Management Framework 3.0 and PS Remoting

Hello, after upgrading my Windows 7 x86 clients to WMF 3.0, I can no longer PS Remote to those machines (using Invoke-Command or Enter-PSSession).  The same update, applied to Windows 7 x64, does not...

View Article
Browsing all 21975 articles
Browse latest View live