| Topic |
 |
RE: is it possible to pass arguments to a background job ? Start-Job -ScriptBlock {param ($folder) mkdir $folder } -ArgumentList $foldername by aleksandar in General PowerShell on 27 Sep 2010 12:02 AM
|
 |
RE: Get list of users who have not logged in for X days http://dmitrysotnikov.wordpress.com/2010/07/30/locating-obsolete-users-and-computers/ NotLoggedOnFor – to specify the number of days since last time the account was used to log on (note that LastLogonTimestamp parameter is used, which means that it ... by aleksandar in Active Directory on 30 Jul 2010 02:14 AM
|
 |
RE: Remote PC time format A culture-aware way is to use the -as operator: '24.1.2010' -as [DateTime] This time, the string information is interpreted according to your current culture. Does this help? by aleksandar in General PowerShell on 15 Mar 2010 11:02 AM
|
 |
RE: "winrm quickconfig" and group policy? Great blog post. Lots of details. Thanks for a shout-out. We plan to cover more "remoting in an enterprise" topics in a next edition. by aleksandar in General PowerShell on 04 Mar 2010 05:18 AM
|
 |
RE: Restricting Available Commands in Script Execution Here is an example for you. The following script c:\scripts\restrictions.ps1 is used to disable an access to all applications and scripts. It also allows users to run only a few cmdlets and restricts the PowerShell language elements to a very limite ... by aleksandar in General PowerShell on 28 Feb 2010 08:43 AM
|
 |
RE: system administrator not a programmer I would recommend free eBook "Mastering PowerShell" written by PowerShell MVP Tobias Weltner. You can read online version or download PDF (20 chapters; ~600 pages) at http://powershell.com/cs/blogs/ebook/ You will start with the basics and finish w ... by aleksandar in General PowerShell on 08 Dec 2009 08:48 AM
|
 |
RE: Pass command parameters to Invoke-command PS H:\> Invoke-Command -ComputerName Server1 -ScriptBlock {Invoke-Expression "C:\Program Files\VERITAS\NetBackup\bin\admincmd\bppllist .exe VCB_VMGuests-01-RAID5-VMFS"} -aleksandar http://powershellers.blogspot.com by aleksandar in General PowerShell on 08 Dec 2009 08:39 AM
|
 |
RE: Get-QADUser Twice In Script Your sample script has worked for me. Can you try it in one line too: Get-QADUser -service DC01 -identity MYDOM\User1 -IncludeAllProperties | Move-QADObject -NewParentContainer "OU=Disabled,DC=test,DC=com" | Get-QADUser -IncludeAllProperties | ... by aleksandar in Active Directory on 06 Dec 2009 10:41 PM
|
 |
RE: Test-Path with credentials The only provider that supports the use of credentials is WSMan (PowerShell 2.0). PS> Get-PSProvider Name Capabilities Drives ---- ------------ ... by aleksandar in General PowerShell on 03 Dec 2009 09:53 AM
|
 |
RE: How to retrive $LASTEXITCODE from a invoke-cammand in a pssession Maybe I don't understand what you are after, but this will assign remote $LASTEXITCODE to local variable: $remotelastexitcode = Invoke-Command -session $RemoteSession -ScriptBlock {$LASTEXITCODE} by aleksandar in General PowerShell on 02 Dec 2009 08:01 AM
|
 |
RE: Reading From AD You don't need to install Quest AD cmdlets on the servers. An installation on admin machine is enough. by aleksandar in Active Directory on 02 Dec 2009 07:00 AM
|
 |
RE: Monitoring windows services Trevor, I've wanted to link to your article too. :) I've really enjoyed reading it. I'm looking forward to reading the next one. by aleksandar in General PowerShell on 01 Dec 2009 02:43 AM
|
 |
RE: invoke-command remote start exe (UNC) I think you need Credential Security Service Provider (CredSSP) authentication to resolve "double hop" issue. You can find more info at http://technet.microsoft.com/en-us/library/dd819517.aspx (help topic for Enable-WSManCredSSP) by aleksandar in General PowerShell on 30 Nov 2009 11:41 AM
|
 |
RE: invoke-command remote start exe (UNC) Cmdlet Invoke-Expression is what we are looking for. :) Invoke-Command -session $RemoteSession -ScriptBlock {param ($Path) Invoke-Expression "$Path\Snapshot.exe C: \\Server\Data\bkup\snapshot\testpc03\091125\testpc03_C_091125.SNA"} -ArgumentList $S ... by aleksandar in General PowerShell on 30 Nov 2009 10:33 AM
|
 |
RE: invoke-command remote start exe (UNC) Can you try this: Invoke-Command -session $RemoteSession -ScriptBlock {param ($Path) $Path\Snapshot.exe C: \\Server\Data\bkup\snapshot\testpc03\091125\testpc03_C_091125.SNA} -ArgumentList $ServerPath You need the ArgumentList parameter to assi ... by aleksandar in General PowerShell on 30 Nov 2009 12:00 AM
|
 |
RE: Listing local user accounts on remote machines If you prefer WMI you could use Win32_UserAccount class, but be aware that result depends on a type of remote computer.If you run Get-WmiObject Win32_UserAccount -computer $computer | select nameagainst member server or client machine, you will get ... by aleksandar in General PowerShell on 16 Jun 2009 01:52 AM
|
 |
RE: Listing local user accounts on remote machines You can try this:$computer = [ADSI]("WinNT://$strComputer,computer")$computer.name$users = $computer.psbase.children |where{$_.psbase.schemaclassname -eq "User"} | select nameforeach ($user in $users) {$user.name}-aleksandarhttp://powershell ... by aleksandar in General PowerShell on 15 Jun 2009 11:24 PM
|
 |
RE: Have to get words from a notepad... The single quotes aren't needed: "$Word was found in $Location, $(@($m).count) times on the following lines" by aleksandar in General PowerShell on 30 May 2009 10:07 AM
|
 |
RE: Converting an array based property to a string I would recommend using LDAP filter. It's much faster than piping to Where-Object. Get-QADGroup -SizeLimit 0 -ldapfilter "(mail=*)" by aleksandar in General PowerShell on 30 May 2009 08:43 AM
|
 |
piping to select * gives me the errors on Windows 7 The commands get-service | select * and get-process | select * give me the errors on Windows 7. Piping to format-list * works without the exceptions.I've got an exception getting ServiceHandle property on more than 10 services when I run get-service ... by aleksandar in General PowerShell on 13 Apr 2009 12:23 PM
|
 |
RE: Reporting Account Types > what is strange is that the -match operator allows me to use the | as an OR: The -match operator does regular expression comparison (case insensitive). Alternation is the regular expression equivalent of "or" and a vertical bar or pipe symbol i ... by aleksandar in Peer Review on 15 Nov 2008 11:32 AM
|
 |
RE: Adopt standard of deploying PS on all new Windows 2003 installs? IMO, there are no real benefits to do that. For real remote management we have to wait for final V2 (you would not install CTP or Beta release on a production server, right?) and to use remote capabilities of Get-WmiObject in V1 you only need -Compu ... by aleksandar in General PowerShell on 13 Nov 2008 11:40 AM
|
 |
RE: Working script breaks For some reason, it can't contact the WMI service on one of remote machines in $servers variable. Most likely one of your servers is offline. You could check with WBEMtest to exclude PowersHell as the cause of the problem. Also, you should check the ... by aleksandar in General PowerShell on 13 Nov 2008 04:40 AM
|
 |
RE: Get Services Info and Export to CSV I would output an object ($services) and then later choose the final format of the results (csv file, table, list...) get-qadcomputer -sizelimit 0 | where {$_.OSName -match "Server"} | select dnshostname | export-csv c:\temp\servers.csv $servi ... by aleksandar in General PowerShell on 28 Oct 2008 02:27 PM
|
 |
RE: query machine name, operatingSystem doesn't work Try with lower case "s" in $objItem.operatingsystem. ;-) foreach ($objResult in $colResults) {$objItem = $objResult.Properties; $objItem.name;$objItem.operatingsystem} -aleksandar http://powershellers.blogspot.com by aleksandar in Active Directory on 22 Oct 2008 02:05 PM
|
 |
RE: GWMI -filter parameter questions. Your $filter looks like "startname='domain\\user'" and those double quotes are the source of your problem. It should be just startname='domain\\user' So, you could use Brandon's filter $filter = "startname='{0}\\{1}'" -f $cred.UserName.split(" ... by aleksandar in General PowerShell on 21 Oct 2008 01:31 AM
|
 |
RE: audit file access This is pretty much the same as Marco's, but a little bit cleaner with a nice scriptblock trick. ;-) $start = [datetime]"2008/05/01" $end = [datetime]"2008/08/31" $period = {$_.lastwritetime -gt $start -and $_.lastwritetime -lt $end} gci | w ... by aleksandar in General PowerShell on 11 Oct 2008 07:13 AM
|
 |
RE: Query and update Computer Description on multiple Servers? If you want to query all accessible Windows Server 2003 machines in your AD, you can do it this way: # first we search AD and filter all Windows Server 2003 machines $root = [ADSI]'' $searcher = new-object System.DirectoryServices.DirectoryS ... by aleksandar in General PowerShell on 06 Oct 2008 03:19 PM
|
 |
RE: Checking Service/Process existence & status Check to see if the Windows firewall on that machine is blocking you. by aleksandar in General PowerShell on 24 Sep 2008 05:45 AM
|
 |
RE: Problem outputting to a file. There are so many different cases of usage of () and {}. I think you can't find that kind of an info in just one article. You could try with: 1. official Windows PowerShell Quick Reference http://www.microsoft.com/downloads/details.aspx?familyid ... by aleksandar in Active Directory on 05 Sep 2008 02:17 AM
|