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

Checking other browsers used

$
0
0

Hello,

I am a powershell scripts beginner... I want to check what browsers are used by my users. I made this script below which is correctly running. I just want to check too chrome.exe, safari.exe and opera.exe but I don't know how to proceed... I'm sure that it exists a simple solution.

Maybe someone here could help me...

$username = gc env:username

$computername = gc env:computername

$date = Get-Date -Format "%d'/'%M'/'%y"

 

$target = "Firefox"

 $process = Get-Process | Where-Object {$_.ProcessName -eq $target}

 while ($true)

 {

 while (!($process))

 {

 $process = Get-Process | Where-Object {$_.ProcessName -eq $target}

 

 start-sleep -s 5

 }

 if ($process)

 {

 #"Place action on process start here”

 "$username;$Target;$computername;$date" | Out-File "\\x.x.x.x\tmp\Browsers.csv" –Append

 

 $process.WaitForExit()

 start-sleep -s 2

 $process = Get-Process | Where-Object {$_.ProcessName -eq $target}

 #“Place action on process exit here”

 }

 }

 

 

 


Viewing all articles
Browse latest Browse all 8583

Trending Articles