-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dropbox.ps1
30 lines (22 loc) · 1017 Bytes
/
Dropbox.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[string]$compName = $env:COMPUTERNAME
[string]$userName = $env:USERNAME
[string]$user_comp = "$userName;$compName;"
[string]$last_email = ""
[string]$email = ""
[string]$path = ""
[string]$result = $user_comp
# Dropbox
if (Test-Path "$env:LOCALAPPDATA\Dropbox" -ErrorAction SilentlyContinue) {
$result += "Dropbox installed;"
if (Test-Path "$env:LOCALAPPDATA\Dropbox\info.json" -ErrorAction SilentlyContinue) {
$DropBox = (Get-Content "$env:LOCALAPPDATA\Dropbox\info.json" | Out-String | ConvertFrom-Json).personal | select path,subscription_type
if ($DropBox) {
$result += ";" #email
$path = $DropBox.path
$subscription_type = $DropBox.subscription_type
$result += "$path;"
$result += "Dropbox is used. Subscription Type: $subscription_type;"
}
} else { $result += ";;Dropbox not configured;" }
} else { $result += "Dropbox not installed;;;;" }
$result > "\\fileserver\$compName-$userName.txt"