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

Get-AdObject complex filters

Hi all,here is my command to get all ad users in a specified OUGet-ADObject -Filter {ObjectClass -eq "user"} -searchbase $CustomOUBut i need to get all users from entire domain with a filter like "not...

View Article


How to pass a variable through Invoke-Command? $Args?

Howdy,I've done some searching and found some things about the $args variable, but haven't found something that explains how it works.I'm simply running these commands:$AppPool =...

View Article


load (or autoload) powershell module from central share

hi there,in big companies some people are developing powershell modules - and others should be able to use those modules. How can I establish a kind of psh-modules 'central storage location' on the...

View Article

Retrieve list of users that have messages larger than 25 MB in their mailboxes?

Is it possible to use Power Shell to search user mailboxes to see if they have any message (including attachments) that are larger than 25 MB?  Outlook has a feature to search for that.  However, we...

View Article

Robocopy with minage/maxage value as date and time

Hi,I would like to copy some files every hour as per the files created every hour, is there any option that could give MAXAGE / MINAGE value with hours/minutes. Or it accept only date (yyyyMMdd)

View Article


How to add local groups to local user account PS script

Hello, I am a PowerShell 3.0 novice and want to add a feature to my first ever production script tool.The script below will get all local user accounts from remote computers listed in a .txt file then...

View Article

Need to modify text in a file.

So I have some entries in my Hosts file that are used for testing.  I need to swap two of the pieces of data and am having trouble.I read in the data like this:$hosttemp =...

View Article

Delete files/folders on remote servers using powershell

Hello, i am new to powershell.i am trying to delete some files & folders from remote computers (server-1, server-2. server-3, server-4) Some are windows 2003 server are some are 2008folders to be...

View Article


Run with Powershell and as administrator

When right-click a .ps1 file and select "Run with Powershell", the .ps1 file will be run in powershell with no elevation. And "Run this program as administrator" checkbox grayed out in the properties...

View Article


How to Uninstall application on remote Winfows 2008/ 2003 using powershell

Hello, i like to uninstall some installed application on remote server1, i want to check weather abc application is install on server1, server2, server3, if it is exist, uninstall it 2, install...

View Article

Can't use test-path for \\?\ paths

I have a problem on only one server that I am unable to use Test-Path successfully when using paths prefixed with \\?\. On every other server we have the command works as expected (that's a mixture of...

View Article

backup and restore a specific registry key in powershell

I am building a 2 scripts one to backup a large number of files and system settings and one to restore them after the system is re-imaged.  I have everything set in the script but 1 thing I dont know...

View Article

Comparing Powershell two excel files and repalce

I am new to Powershell, I need help comparing two excel files and need for it to look at the old file and get info from it and push it into the new file. If the ID is same. Here is an Idea of what I...

View Article


try/catch in a foreach loop problem

 Hi. I'm having trouble with try/catch in a foreach loop. I'm trying to get my ps1 to run a SQL script but only against servers it can connect to. Here's what I've done so far; if I don’t use a foreach...

View Article

PowerShell Exlaining this Script, for Understanding

function Import-OldXLS { [CmdletBinding()] #bind the parameters of the function param ( #define parameters as mandatory, specify a position [Parameter(Mandatory=$true,Position=0)] [System.String]...

View Article


Converting WMI Date/Time in Excel Using VBS

I am using the following VBScript to retrieve date created, date last accessed and date last modified.  This info is then put into an Excel spread sheet.  I need to have the date format changed from...

View Article

WMI query spilling over to host output instead of variable after 200 results...

$tmp = get-adcomputer -filter "BLAH that gives me 480 machines" $tmp = $tmp | select Name $cs = Get-WmiObject win32_computersystem -ComputerName $tmp.NameAfter machine 200 Powershell starts spewing...

View Article


Unable to determine "true" data type of Cmdlet parameter

I have a Cmdlet called Make-VArrayList. It creates an object (VArrayList) that extends System.Collections.ArrayList. It is designed to take any input - an Object, Object[], ICollection, ArrayList, or...

View Article

Creating array from get-mailboxdatabase that includes mailbox counts

Exchange 2010 SP2. Exchange forum suggested posting this over here. I am trying to create an array containing the results of get-mailboxdatabase (name,size, provisioning) but to also include a count...

View Article

Can I get a variable from a variable?

So I have a list of items in a String array  ($colors= 'red','blue','green', etc) and I also have a variable for each item ($red='1' $blue='1' $green='0', etc)The list of items in the array are things...

View Article
Browsing all 21975 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>