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

Error Handling

$
0
0

I have just finished the shell i was writing to copy modify and upload images. Very satisfying, and i have set the process to be started through an ssis package as it is a simple and effective way and the notification feature on fail and success is critical. 

Is there a way though to pass any errors in the shell itself pass to a function so i am notified in the event of a runtime error in the script. 

-Erroraction throw values and i was wondering if there was a way to use this with an if statement to trigger the function.


Friday Fun – A Popup Alternative

$
0
0

In the past I’ve written and presented about different ways to add graphical elements to your PowerShell scripts that don’t rely on Windows Forms or WPF. There’s nothing wrong with those techniques, but they certainly require some expertise and depending on your situation may be overkill. So let’s have some fun today and see how you can display a popup message in a graphical form, using something you already know how to use.

Read More

Process a csv and append to a txt file - help needed!

$
0
0

Hi,

I'm new here and I'm hoping someone can help and show off their PowerShell skills at the same time!

I want to create a script that processes a CSV file and pulls data from certain columns and rows and appends them to a TXT file. The text file is actually intended for import to Ventura 10 and so must contain some standard mark up too. Like this...

 

@NO. = 3.

@DESCRIPTION = 1576 CORSINI MAIL. A fine entire Paris to "Filippio Corsini in London" dated 20 August 1576. (Ref<N>83098)

@PRICE = <156>185.00
In the example above '@NO. =' should increase by 1 each time a row is processed. '@DESCRIPTION =' is direct from a CSV column. 'Ref<N>' is direct from a CSV column. '@PRICE' = is direct from a CSV column. So, I'd like the script to:- * ask user to input variable * use that variable to determine which rows to process by matching it in the relevant column e.g. List number 141 * process each row and append data from the description, ref number, and price columns as above * add the necessary Ventura mark up


From the research I've done so far I think Import-Csv, Where-Object, and Out-File will be used but I don't know enough to get started. If someone could provide me with a basic template I could take it from there. Many thanks!

 

Import from CSV to snapshot VMs

$
0
0

Hi guys, I'm really new to powershell and I'm trying to do something fairly simple. I have a CSV file which contains the names of a couple of VMs I want to snapshot.

Here is my code

Add-PSSnapin "VMware.VimAutomation.Core"
connect-viserver 192.168.1.162 -user root -password password

$VMs_to_snap=import-csv c:\temp\test.csv
foreach ($VM in $VMs_to_snap) {
get-vm -name $VM | new-snapshot -name test_snap
}

It looks like the problem is that it's including the header of the CSV along with the VM name but I don't know how to strip that out. It errors out saying that the name was not found. Instead of sending VM3 as the name, it's sending VM Name=VM3 (in bold below).

 

get-vm : 13/09/2014 6:55:35 PM    Get-VM        VM with name '@{VM Name=VM3}' was not found, using the specified filter(s).   
At C:\temp\snapshot_vm_from_csv.ps1:14 char:1
+ get-vm -name $VM | new-snapshot -name test_snap
+ ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [Get-VM], VimException
    + FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM

 

How do I get it so it doesn't include the header and only sends the name?

Filter services by status and name

$
0
0

I want to retrieve a list of services that are running but also want to filter out some services by name

As there are many services that I want to exclude I want to put them in an array such as:

$ServicesToIgnore = "BITS", "BFE" etc

I can do this manualy as below but am struggling to get this to work with an array.

 

 

 

 

get-service | Where-Object {$_.status -eq"Running"-and$_.name -ne"BFE" -and$_.name -ne"BITS"}

Thanks.

Sysprep from within PowerShell

$
0
0

I am trying to deploy VM's from templates in VMware, but I having problems with OSCustomization, so I thought I would just run sysprep from Invoke-VMScript.  

Before trying to make it work in the PowerCli cmdlet, I thought I would just see if I could run Sysprep from with PowerShell.

$command = "C:\Windows\System32\Sysprep\Sysprep.exe /generalize /oobe /shutdown /quiet"

Invoke-Expression -command "$command"

I am running this on a 2012 r2 server and I am getting this window popping up:

If no command-line arguments are provided, a graphical user interface is used to select the desired Sysprep operations.

What am I missing?

 

How to write key value using PowerShell?

$
0
0

Hi~.

I try to control MS-DOS program. 

The program name is CARI-6M. 

You can download http://www.faa.gov/data_research/research/med_humanfacs/aeromedical/radiobiology/cari6m/ . 

The CARI-6M has text GUI environment. 

I don't know to write key "1" using Write-Output cmdlet.

I want to input keys instead of human's typing. 

Could you advise some solution? 

Please, help me~~~Beer

----My PowerShell Script--------------

cd c:\cari6mex

dir

.\cari-6m.exe

Write-Output "1"

--------------------------------------

Can a Param VALIDATESET include a command?

$
0
0

Hi Everyone,

I was wondering, can i include a command instead of an array of strings? so that i can generate the the array automatically.

I was thinking something like the example below to generate the Exchange site list.

[ValidateSet((Get-ExchangeServer).site.name | Group-Object | select name))]

 


Getting the output of a batchfile to Powershell

$
0
0

Greetings. I have a list of batchfiles that triggers Powershell script, that will throw error message when different errors were encountered in the execution. 

In the end of the batchfile, I have included:

if%errorlevel% neq 0(echo errorin previous command &exit/b %errorlevel%)

and it works fine in itself. 

However due to some requirements I need to use new separate batchfile that triggers a Powershell, that will in turn lauch the batchfiles mentioned earlier. 

In the new Powershel, I have included: 

$process = start-process $batchFile.FullName -ArgumentList $argumentList -PassThru -Wait 

and is able to get $process.ExitCode. However I would like to get the output or error message that would be raised from the first batchfile instead. 

Any advice?

Continuous loop

$
0
0

Hello again,

I have created a task schedule to check DBA is always logged on. This is at 5 minute intervals. I am thinking a contiuous loop would work better and be less intensive. 

 

for(;;)

{{ $i ; $i++

 }

I tried this loop but whenever i pass If parameters it fails.

Would love to hear some ideas?

 

Count word occurrences in an html file

$
0
0

I have a file that  contains a range of word e.g. alusfw001, gfr3044,hyr0067. the words are sites, what i want to do is use powershell to go into the file "site.html" which has these sites listed and i want to count the number of occurances for each of them. I need to be dynamic to count any without say calling each of them first. 

I could add Site:alusfw001 to make it easier to call on each of them, can anyone help me.

 

Thank you.

Armani vgic fdgx gvsb

$
0
0

輕輕推開仍然依靠在自己肩膀的吳婉欣,蕭聖誇張的拍了拍自己的胸口,嚴肅的說道。嘻之所以這樣,吳婉欣也是想要考驗一下這個男人,是不是真的可以依靠,得到的答案讓這個美麗的小女人幸福的嘴都合不攏了。情商很低的蕭聖又怎會明白吳婉欣此時此刻心中所想,只把這件事當做 ugg 在台灣要去那裡買賣弄自己車技與能力不了了之了,殊不知剛才當真是命懸一線,即使以蕭聖的身體素質,在這種急速,車輛體積又不相符的碰撞下,也絕對非死即傷。

ugg代購,很快,蕭聖的視野中便望見了蕭鴻律所描述的那件酒店,足有七八層之高,門面非常氣派,牌匾上方用的則是日本片假名與中文的結合,在這個時代,能夠有這樣規模的酒店,著實有些令人讚嘆。車停後,蕭聖與吳婉欣相繼走下車,長時間處於緊張狀態 Armani,一落地後,前者明顯感覺到自己雙腿都有些發顫,苦笑一聲,二人對著燈光依舊大亮的大廳緩步而入。

當蕭聖幾人成功下山後,六人一個也不少,不但如此,卻多了一人,此人正是去兌換金條的周霸王。鄭吒, ugg雪靴專賣店可算是下來了,要不是婉欣妹子確定 ugg雪靴專賣店 沒事,我早就衝上去了周霸王大聲叫道。龍天也跟著附和道,吳婉欣等人也微笑的看著蕭聖。抱歉讓大家擔心了!笑了笑,衝吳婉欣點了點頭,蕭聖便望向周霸王問道:霸王,怎麼樣?看你的樣子應該成功了吧?

http://www.f-law.net/law/threads/72027-Timberland-mtmy-waam-afcq?p=515055#post515055

http://www.ahbb.cc/bbs/thread-1471580-1-1.html

https://www.synthesiagame.com/forum/viewtopic.php?f=11&t=1116&p=7446#p7387

Error while running the PS script at first time

$
0
0

Hello,

 

When i execute below script in PS command line, first time this script will not execute and gives error.

Then in same command line window if I run the same script second time it will execute.

Can you please tell what could i need to add for running first time it self?

 

****************************************************

Param(

[String]$CentralServer 

)

 

Function Get-RSSQLInstance {  

 

    [cmdletbinding()] 

    Param (

        [parameter(ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]

        [Alias('__Server','DNSHostName','IPAddress')]

        [string[]]$ComputerName

 

    ) 

 

    Process {

        ForEach ($Computer in $Computername) {

            $Computer = $computer -replace '(.*?)\..+','$1'

            Write-Verbose ("Checking {0}" -f $Computer)

            Try { 

                $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $Computer) 

                $baseKeys = "SOFTWARE\\Microsoft\\Microsoft SQL Server",

                "SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SQL Server"

                If ($reg.OpenSubKey($basekeys[0])) {

                    $regPath = $basekeys[0]

                } ElseIf ($reg.OpenSubKey($basekeys[1])) {

                    $regPath = $basekeys[1]

                } Else {

$q= "No RS Component installed on " +$Computer

write-output $q >> $filenamecompliance

                    Continue

                }

                $regKey= $reg.OpenSubKey("$regPath")

                If ($regKey.GetSubKeyNames() -contains "Instance Names") {

                    $regKey= $reg.OpenSubKey("$regpath\\Instance Names\\RS" ) 

                    $instances = @($regkey.GetValueNames())

                } ElseIf ($regKey.GetValueNames() -contains 'InstalledInstances') {

                    $isCluster = $False

                    $instances = $regKey.GetValue('InstalledInstances')

                } Else {

                    Continue

                }

                If ($instances.count -gt 0) { 

                    ForEach ($instance in $instances) {

                        $nodes = New-Object System.Collections.Arraylist

                        $clusterName = $Null

                        $isCluster = $False

                        $instanceValue = $regKey.GetValue($instance)

                        $instanceReg = $reg.OpenSubKey("$regpath\\$instanceValue")

                        If ($instanceReg.GetSubKeyNames() -contains "Cluster") {

                            $isCluster = $True

                            $instanceRegCluster = $instanceReg.OpenSubKey('Cluster')

                            $clusterName = $instanceRegCluster.GetValue('ClusterName')

                            $clusterReg = $reg.OpenSubKey("Cluster\\Nodes")                            

                            $clusterReg.GetSubKeyNames() | ForEach {

                                $null = $nodes.Add($clusterReg.OpenSubKey($_).GetValue('NodeName'))

                            }

                        }

                        $instanceRegSetup = $instanceReg.OpenSubKey("Setup")

                        Try {

                            $edition = $instanceRegSetup.GetValue('Edition')

                        } Catch {

                            $edition = $Null

                        }

                        Try {

                            $ErrorActionPreference = 'Stop'

                            #Get from filename to determine version

                            $servicesReg = $reg.OpenSubKey("SYSTEM\\CurrentControlSet\\Services")

                            $serviceKey = $servicesReg.GetSubKeyNames() | Where {

                                $_ -match "$instance"

                            } | Select -First 1

                            $service = $servicesReg.OpenSubKey($serviceKey).GetValue('ImagePath')

                            $file = $service -replace '^.*(\w:\\.*\\sqlservr.exe).*','$1'

                            $version = (Get-Item ("\\$Computer\$($file -replace ":","$")")).VersionInfo.ProductVersion

                        } Catch {

                            #Use potentially less accurate version from registry

                            $Version = $instanceRegSetup.GetValue('Version')

                              } Finally {

                            $ErrorActionPreference = 'Continue'

                        }

                        New-Object PSObject -Property @{

 

                            InstalledInstances = {

                                If ($Instance -eq 'MSSQLSERVER') {

                                    "$($Computer)"

                                } Else {

                                    "$($Computer)\$($instance)"

                                }

                            }.InvokeReturnAsIs()

 

                        } | export-csv -NoTypeInformation -path .\rsinstancelist.csv -Append -Force

 

                         }

                }

            } Catch { 

                Write-Warning ("{0}: {1}" -f $Computer,$_.Exception.Message) 

                 }  

        }   

    }

}

 

#-------------------------------------------------------------------------------------------------

# FUNCTIONS: Get all the SSRS instance details by calling the function Get-RSSQLInstance 

#-------------------------------------------------------------------------------------------------

Function Get-instance{

 

Invoke-Sqlcmd -Query "SELECT Server_name FROM TOOLS.dbo.v_ReportingServices_instances" -ServerInstance $CentralServer | export-csv -NoTypeInformation -path ".\rsserverlist.csv" -Append -Force

 

$FileExists = Test-Path ".\rsserverlist.csv"

If ($FileExists -eq $True){

(Get-Content ".\rsserverlist.csv" | foreach {$_ -replace '"'} | Set-Content ".\rsserverlist.txt") 

Remove-Item ".\rsserverlist.csv"

$cnt=(get-content ".\rsserverlist.txt").Count

$cnt=($cnt-1)

gc ".\rsserverlist.txt" | select-object -last $cnt | set-content ".\rsserverlist.txt"

}

 

$serverarray = get-content ".\rsserverlist.txt"

 

foreach($s in $serverarray){

 

 

Get-RSSQLInstance $s

}

 

#-------------------------------------------------------------------------------------------------

# FUNCTIONS: Clean up RS insatnce lsit file and bulk insert into table

#-------------------------------------------------------------------------------------------------

Function Get-instances {

 

$FileExists = Test-Path ".\rsinstancelist.txt"

If ($FileExists -eq $True){

Remove-Item ".\rsinstancelist.txt" }

 

$FileExists = Test-Path ".\rsinstancelist.csv"

If ($FileExists -eq $True){

(Get-Content ".\rsinstancelist.csv" | foreach {$_ -replace '"'} | Set-Content ".\rsinstancelist.txt")

Remove-Item ".\rsinstancelist.csv"

$cntrs=(get-content ".\rsinstancelist.txt").Count

$cntrs=($cntrs-1)

gc ".\rsinstancelist.txt" | select-object -last $cntrs | set-content ".\rsinstancelist.txt"

 

}

 

}

Get-instance

Get-instances

 

get avg value for times

$
0
0

hi there, 

 

 I am totally new to power shell 00:00.74. The below time date is in a text file. 

00:00.64

00:01.02

00:01.36

00:00.25

00:00.92

00:08.21

00:00.62

00:00.42

00:00.43

00:04.33

00:03.58

00:02.41

00:00.68

00:01.87

00:00.73

 

the above time values are in minutes:Seconds.milliseconds. I need the avg value for these times and the max and min value of these times . Any help on this would be appreciable. No idea how to do this. I was able to get- contant of the times times from log file and write it to text file. could not figure out how to do the rest. 

Get-content of the previous day file

$
0
0

 

 

I have two log files files as such with in a folder 

foo.log20140905           9/5/2014 11:04 PM        LOG20140905 File         649kb

foo.log20140906           9/6/2014 11:04 PM        LOG20140906 File         916kb

 

when I run my script   on 6th I should be able to get content of the the file from 5th

  Get-Content "\\Server\LogFiles\foo_pilot\foo.log20140905"  

foo_pilot is the folder which has collection of all the log files dated as  shown above. the script should pic the previous days file when its runs on the present day. I was able to hard code it and get it but should automate the process. Any help on this.  

I tried with the code below by replacing the foo.log20140905 with the "where" object as shown below but could not find a solution 

Get-ChildItem c:\folder\*.* Where{$._LastWrittenTime -gt (Get-Date).AddDays(-1)}

 

 

 

 

 

 


Move-Item giving access denied errors

$
0
0

I'm having an issue with my script and I need assistance in understanding the problem.

I've created a script that creates/archives/reactivates users in AD. The issue comes when a user is archived. The script attempts to move the user's folder from the file server to an archive folder on the file server. The script is not run from the file server, but from my desktop (I create a PSSession to the file server). I only get issues with particular folders, when users move their My Documents folders to their network folder on the file server. I am part of the Domain Admins group, and I have full permissions on each user folder. 

Going into the folder and manually moving the folder gives me no errors, only when running the script. Just wondering if there's anything special about the My Videos, My Music, My Pictures folders that is causing the permissions issue?

Error handeling with Remove-QADMemberOf

$
0
0

Hello all,

I have security on me to limit the users who have local admin access on desktop PC's.  I am at the point where I am trying to remove user account from nested Global Groups that are part of the desktop Administrators group.  During this process I have identified 200+ disabled accounts that are still part of these GG.  I am trying to use the Remove-QADMemberOf - RemoveAll option to deal with these users.  The problem is there are Global Groups that I do not own (or have access to manage) so the script fails when I hit a user that is in one of these groups.  I have tried the -ErrorAction SilentlyContinue option but it still fails and dumps out of the script.

I'm looking for help on 1st - how to get the script to not "stop" and 2nd - dump the user name I am working with to an Error Log file so I can follow-up on them afterwards.

Thanks for any help you can provide.

$Users=Get-Content"h:\DisabledUsers.txt"

ForEach ($MyUserin$Users) 

{Try {Remove-QADMemberOf-Identity$MyUser-Removeall-ErrorAction SilentlyContinue}

Catch {return ("Problem with user $MyUser")

}}

Shadowgroups and sending mail on specific days before password expires

$
0
0

I have no scripting skills, so please be patient with me :-)
We have FGPP in place in combination with shadow groups.
Used http://www.sole.dk/active-directory-shadow-group-script-will-let-you-spend-less-time-on-updating-group-memberships/ to create the shadow groups. Works great.

But now my manager wants to send mail to users, 14, 7, 3, 2, and 1 day before password expires.
I found a script here: http://gallery.technet.microsoft.com/Password-Expiry-Email-177c3e27#content

But I need to edit the script.


Questions 1:
I've created three shadowgroups, and want to query these groups.
Do I edit the script like this:


# Get Users From AD who are Enabled, Passwords Expire and are Not Currently Expired
Import-Module ActiveDirectory
$Group = get-ADGroupmember -identity groupname1, groupname2, groupname3 -filter * -properties Name, PasswordNeverExpires, PasswordExpired, PasswordLastSet, EmailAddress |where {$_.Enabled -eq "True"} | where { $_.PasswordNeverExpires -eq $false } | where { $_.passwordexpired -eq $false }
$maxPasswordAge = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge

# Process Each User for Password Expiry
foreach ($user in $Group)

Question 2:
To send mail on the specific days before password expire, do I edit the script like this:
# Send Email Message
    if (($daystoExpire) -eq  (("14") -or (("7") -or (("3") -or (("2") -or ("1")))

I think the syntax is probably wrong.

Question 3:
Do I need to edit other lines in the script.

Thanks

Using objects correctly to compare various Registry Keys on different Servers

$
0
0

I would like to compare two Servers registry keys to make sure they both match.

 

Something simple like this was the initial plan:

 

    $remote1 = (invoke-command -computername hostname `

    {Get-ItemProperty     "HKLM:SOFTWARE\VENDOR\APP\SUBFOLDER"})

    $local1 = (invoke-command `

    {Get-ItemProperty  "HKLM:SOFTWARE\VENDOR\APP\SUBFOLDER"})

 

    $compare1 = Compare-Object $local1 $remote1

 

That works great for one single specified key but I have multiple keys with sub folders. I can't provide a list of the ones I want to check (and loop round) as I want to make sure nothing new has been added. So I was drawn down this route to get all the keys under a specified branch in the Registry (to get me a list):

 

    $local1 = Get-ChildItem HKLM:SOFTWARE\MICROSOFT\DirectShow -Recurse `

    -ErrorAction SilentlyContinue

 

So I now have an object that will tell me all the registry SUBFOLDERS on the server and I could then loop round using $local1.PSPath to give me all the paths but I noticed something in the object that was interesting:

 

    $local1 | select -first 1 -prop *

 

This returns:

 

    Property      : {dbl3, dbl4, dbl5, dbl6...}

    PSPath        : A path 

    PSParentPath  : A Parent Path 

    PSChildName   : 0

    PSDrive       : HKLM

    PSProvider    : Microsoft.PowerShell.Core\Registry

    PSIsContainer : True

    SubKeyCount   : 0

    View          : Default

    Handle        : Microsoft.Win32.SafeHandles.SafeRegistryHandle

    ValueCount    : 8

    Name          : A Name

 

 

So the Object member "Property" contains what looks like an array of all the keys or is it a sub Object?

 

 

If it was a sub-object does it contain the keys values that I am looking to compare?

 

I could just snatch out the $local.Name member and loop round comparing using the code above and storing any differences but I just wondered if it would be more efficient to use the data that I already have if it contains the information I need?  

 

I am hoping that someone could confirm that if I did:

 

     $local1 = Get-ChildItem HKLM:SOFTWARE\MICROSOFT\DirectShow -Recurse `

    -ErrorAction SilentlyContinue

 

     $remote1 (invoke-command -computername remoteserver1 `

     {Get-ChildItem HKLM:SOFTWARE\MICROSOFT\DirectShow -Recurse `

     -ErrorAction SilentlyContinue})

 

When I do the compare am I actually comparing the keys and values match or just that keys exist? :

 

    Compare-Object $local1 $remote1

 

To cut a long story short, I think I have all the data I need to compare that the Registry key values match (by running this):

 

    $local1

 

Returns (extract):

 

    Hive: HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\DirectShow

 

 

    Name                           Property                                                                                                                                                       

    ----                           --------                                                                                                                                                       

    Debug                                                                                                                                                                                         

    DoNotUse                                                                                                                                                                                      

    DoNotUseDrivers32                                                                                                                                                                             

    Preferred                      {00001602-0000-0010-8000-00aa00389b71} : {E1F1A0B8-BEEE-490D-BA7C-066C40B5E2B9}                                                                                

                                   {e06d8032-db46-11cf-b4d1-00805f6cbbea} : {E1F1A0B8-BEEE-490D-BA7C-066C40B5E2B9}                                                                                

                                   {00000160-0000-0010-8000-00aa00389b71} : {2eeb4adf-4578-4d10-bca7-bb955f56320a}                                                                                

                                   {41564D57-0000-0010-8000-00AA00389B71} : {82d353df-90bd-4382-8bc2-3f6192b76e34}                                                                                

                                   {e06d8026-db46-11cf-b4d1-00805f6cbbea} : {212690FB-83E5-4526-8FD7-74478B7939CD} 

 

Am I correct and does anyone know how to access individual items from the $local1 object? Taking the example above, what is a Hive? Say I wanted the "00001602-0000-0010-8000-00aa00389b71" value how would I get it from the $local1 object.

 

A point to note that the servers are running Powershell 2 while I am testing on Powershell 4 (I can't test on a Production server). I mention this as running $local1 on the v2 servers I get a different output in that the properties do not seem to be in pairs.

 

    Hive: HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\DirectShow

 

 

    SKC  VC Name                           Property

    ---  -- ----                           --------

    0   0 Debug                          {}

    0   0 DoNotUse                       {}

    0   0 DoNotUseDrivers32              {}

    0  10 Preferred                      {{00000050-0000-0010-8000-00AA00389B71}, {e436eb80-524f-11ce-9f53-0020af0ba77...

 

Is this case where the v4 objects will do what I want but the v2 won't? 

Retrieving user's Volatile Environment data from remote computer

$
0
0

Hi,

I'm currently working on a script which takes a computername and a domain username and uses it to retrieve registry information from a remote computer. The purpose of this script is to retrieve some information from the Volatile Environment registry path which we will use for remote support.

After some research I have found that accessing the remote computers HKEY_CURRENT_USER folder in the registry is troubling from a remote computer, but I've found that the HKEY_USERS also provides a way to access this information.

Now I'm searching for a way to let my script search the SID's from the HKEY_USERS folder, find the corresponding username which was entered at the start and show me the corresponding SID and possibly even the accompanying Volatile Environment information.

I'm having the feeling I'm -somewhat- in the right direction, but I can't find the right way to search for the right key. Anyone knows a way to get this working?

A small schematic setup is the following:

Start -> Enter Rem. Computername & Rem. Username -> Script searches for the corresponding SID -> Return Volatile Environment data to Start computer.

Viewing all 6937 articles
Browse latest View live