header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Search
Search Area
Criteria Options
Search Topics From
Search By User
Search in Forum(s)
Included Forums: ALL
Topic
RE: Getting Output From Powershell Jobs Into Variable
#sorry, forgot to mention to use write-output instead write-host. as you said you do not need to output it to host :)#final commands are$ScriptBlock = { write-output "hi" }$Job = Start-Job -ScriptBlock $ScriptBlock$JobOutput = [String](Recei ...
by Mihail Stacanov in General PowerShell on 12 Aug 2010 08:03 AM
RE: Getting Output From Powershell Jobs Into Variable
$joboutput = [string](Receive-Job -Job $Job -Keep)#ok make your job's output to string and it you will be able to put it to variable
by Mihail Stacanov in General PowerShell on 12 Aug 2010 05:23 AM
RE: PowerShell and XML list elements
#if you import xml than that fields becomes a properties of objects#try import you xml and get-member itImport-Clixml d:\xml.xml | gm
by Mihail Stacanov in General PowerShell on 12 Aug 2010 04:42 AM
RE: Getting Output From Powershell Jobs
#I've used this for ability to receive job's output. But here is one problem, if the job didn't complete I receive it's current output.$ScriptBlock = { write-host "Test before Sleep"; Start-Sleep 30; Write-Host "Test after Sleep" }$Job = Start-Job - ...
by Mihail Stacanov in General PowerShell on 12 Aug 2010 04:31 AM
RE: get-wmiobject win32_printer name includes twice as many "\"?
#this is my outputGet-WMIObject -query "select * from win32_printer"Location      : Name          : NPIF94A0D (HP LaserJet P2055dn)PrinterState  : 0PrinterStatus : 3ShareName     : SystemName    : PC1Location      : Name          : Adobe PDFPrinterS ...
by Mihail Stacanov in General PowerShell on 11 Aug 2010 07:43 AM
RE: Set Keyboard Layout based on Group Membership
#Try this script. It also checks if user exists in both groups and sends an email with warning $UserName = $env:username $Filter = "(&(objectCategory=User)(samAccountName=$UserName))" $Searcher = New-Object System.DirectoryServices.DirectorySear ...
by Mihail Stacanov in Active Directory on 11 Aug 2010 07:34 AM
RE: Seach by e-mail address across 2 domains...
#Just one string if you have Quest AD CmdLets Import-Csv d:\email.csv | foreach {Set-QADUser $_.logonname -Email $_.email -WhatIf}
by Mihail Stacanov in Active Directory on 11 Aug 2010 06:51 AM
RE: Essentials Workshop series - PowerShell
Thanks but I should wait for Don Jones here in Moldova :)
by Mihail Stacanov in Books, Tools, and Videos on 11 Aug 2010 06:36 AM
RE: get-wmiobject win32_printer name includes twice as many "\"?
#please post you script and show your code, because I can't see the output like yours mine is: Get-WmiObject win32_printer -ComputerName PCNAME | ft name name ...
by Mihail Stacanov in General PowerShell on 11 Aug 2010 06:33 AM
RE: on which computer the user locked themselves?
#I think you can take a event log message from your DC (if you have logon/logoff logging) using this script Get-QADUser -Locked | foreach ` { Get-EventLog Security -ComputerName DC -InstanceId 540 -UserName $_.NTAccountName -Newest 1 | fl ...
by Mihail Stacanov in Active Directory on 12 Aug 2010 03:47 AM
RE: Need to automate file rename, raw text to .doc, Word macro processing
#You can use this script $name = (Get-Content d:\Text.txt | Select -first 1) [Void] [Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Interop.Word") $MSWord = New-Object -com word.application $document = $MSWord.docume ...
by Mihail Stacanov in General PowerShell on 11 Aug 2010 02:30 AM
RE: Reading Remote Registry ACLs with PowerShell
The .NET FCL GetAccessControl method cannot be used to get the permission on the remote machine registry key, the FCL doesn't provide this functionality If you have WinRM, and PowerShell installed remotely, you can call PowerShell on the remote s ...
by Mihail Stacanov in General PowerShell on 11 Aug 2010 01:27 AM
RE: Listing local users, admin and service accounts
#I am using Quest AD CmdLets for getting a list of Servers http://www.quest.com/powershell/activeroles-server.aspx#Gets servers with Windows 2003Get-QADComputer -OSName *2003* | ForEach-object `    {#check their ping    if (Test-Connection $_.name - ...
by Mihail Stacanov in General PowerShell on 11 Aug 2010 12:51 AM
RE: How to change powershell configuration file at run time
#You can use these commands#Put your code in your profile"Write-Host 'Test'" | Set-Content $profile#After that run your profile& $profile
by Mihail Stacanov in General PowerShell on 11 Aug 2010 12:36 AM
Update List Items' Fields in Sharepoint
Hi AllHow can I update or change list items values with Powershell in Sharepoint.Im using this code[void][System.reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")$spSite = new-object Microsoft.SharePoint.SPSite("mysit ...
by Mihail Stacanov in SharePoint on 17 Nov 2009 07:14 AM
Active Forums 4.3
right
footer   footer
footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
footer   footer