27 lines
1,002 B
PowerShell
27 lines
1,002 B
PowerShell
|
|
function Invoke-CMDBweblaunch {
|
||
|
|
|
||
|
|
param {
|
||
|
|
[string]$comp
|
||
|
|
}
|
||
|
|
Write-Host "Querying CMDB..."
|
||
|
|
|
||
|
|
try { $cmdbData = Get-LANDeskCMDBItem -Name $comp } catch { $cmdbData = $null}
|
||
|
|
if($null -eq $cmdbData){
|
||
|
|
Write-Host "CMDB hostname mismatch" -ForegroundColor Yellow
|
||
|
|
Write-Host "Running Get-PC Lookup for asset tag"
|
||
|
|
$getpcData = get-pc $comp
|
||
|
|
try { $cmdbData = Get-LANDeskCMDBItem -AssetTag $getpcData.'Asset Tag'} catch{ $cmdbData = $null }
|
||
|
|
if($null -eq $cmdbData){
|
||
|
|
Write-Warning "Unable to find record with assset tag in CMDB"
|
||
|
|
Write-Host "Unable to launch record page" -ForegroundColor Yellow
|
||
|
|
return
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
Write-Host "CMDB record found - launching Landesk page in IE"
|
||
|
|
$uri = "https://shslandesk/WebAccess/wd/object/open.rails?class_name=_CMDBManagement.Call&key="
|
||
|
|
$fulluri = $uri + $cmdbData.key
|
||
|
|
Start-Process $fulluri
|
||
|
|
return
|
||
|
|
}
|