logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Scott  
#1 Posted : Wednesday, March 16, 2016 3:06:06 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,380
United States

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
UserPostedImage

This extension adds system-specific information to the General tab such as Computer Model, Manufacturer, Bios Name, and Serial Number. The information is automatically retrieved through a simulated shell behind the scenes, there is no need to manually query the information.

UserPostedImage

Requirements:
-Windows Guests only
-Powershell 2.0+
-ScreenConnect Server and Guest version 5.5+

Notes:
This is an alpha release and as such there may be some issues. Please respond to this post with any feedback!

Edited by user Thursday, March 31, 2016 2:41:06 PM(UTC)  | Reason: Not specified

ScreenConnect Team
Cooper  
#2 Posted : Wednesday, March 16, 2016 4:54:24 PM(UTC)
Cooper


Rank: Advanced Member

Medals: Bug Buster Level One: Spoon!Level 1: Random Act of Kindness! Received One Thanks!

Joined: 10/28/2015(UTC)
Posts: 42
United States
Location: WA

Thanks: 10 times
Was thanked: 4 time(s) in 4 post(s)
Hello,

Thank you for providing this extension.

Do you know about how long it should take to update that information? I installed the extension about 30 minutes ago, and the only machines that are updating that information are the ones that I double-clicked "Update Guest Info." Is there a way to send a command to bulk update all the computers so that it will update the information the extension provides?
Cooper  
#3 Posted : Wednesday, March 16, 2016 6:12:45 PM(UTC)
Cooper


Rank: Advanced Member

Medals: Bug Buster Level One: Spoon!Level 1: Random Act of Kindness! Received One Thanks!

Joined: 10/28/2015(UTC)
Posts: 42
United States
Location: WA

Thanks: 10 times
Was thanked: 4 time(s) in 4 post(s)
Originally Posted by: Cooper Go to Quoted Post
Hello,

Thank you for providing this extension.

Do you know about how long it should take to update that information? I installed the extension about 30 minutes ago, and the only machines that are updating that information are the ones that I double-clicked "Update Guest Info." Is there a way to send a command to bulk update all the computers so that it will update the information the extension provides?


Oh ok, I see how that works now. If I click on the General tab then it populates the information. I was thinking I could just click from machine to machine and it would automatically populate. It works for us. I'll update the other thread with this comment.
KBrownConsulting  
#4 Posted : Thursday, March 17, 2016 2:06:25 AM(UTC)
KBrownConsulting


Rank: Advanced Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 3/11/2014(UTC)
Posts: 69
United States

Thanks: 13 times
Was thanked: 8 time(s) in 5 post(s)
I'm having problems with the extension on SC 5.3.9074.5646

The extension installs successfully & the new fields (Model, Manufacturer, BIOS Name, BIOS Serial) show up on the General Tab, but now whenever I click to the General tab the following error pops up on the screen: Session group 'M' does not exist and the new fields remain unpopulated.

I had the exact same error popup when I tried to refresh the details for the Remote System Diagnostics extension and I just assumed it was because I'm using an older SC version so I disabled that extension. But since your release notes say this extension should work with SC servers all the way back to 5.2 I decided to give it a try... Any ideas or things you want me to try?

(BTW, I'm still on 5.3 because I haven't wanted to deal with the delayed auto-start that was introduced in 5.4 which means I plan to upgrade to 5.6 as soon as it is released as stable.)

Thanks
jonmcknight  
#5 Posted : Thursday, March 17, 2016 1:42:28 PM(UTC)
jonmcknight


Rank: Advanced Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 1/30/2015(UTC)
Posts: 41
United States

Was thanked: 7 time(s) in 5 post(s)
It doesn't appear to be working at all for me.

Server SC version: 5.4.9675.5750

Guest SC version: 5.4.9675.5750

Guest Powershell version: 2.0

Empty Fields:
No Data

Error Details:
Extension Error
tomlaf  
#6 Posted : Thursday, March 17, 2016 2:51:43 PM(UTC)
tomlaf


Rank: Member

Medals: ScreenConnect Advisor: Focus Group Member

Joined: 10/28/2015(UTC)
Posts: 40
Canada
Location: Sherbrooke

Was thanked: 1 time(s) in 1 post(s)
I do see the commande been requested 2 time in a row after a F5.
kappa  
#7 Posted : Monday, March 21, 2016 2:00:51 PM(UTC)
kappa


Rank: Newbie

Joined: 4/24/2015(UTC)
Posts: 3
United States
Location: Florida

We are seeing inconsistencies in the new fields populating details. Sometimes its automatic, sometimes we can manually click on the "Update Guest Info" but the most consistent method to update is to switch tabs. for example move from General to Commands, then come back to General. After about 5-10 seconds the new fields will populate.

Is this a known issue? We are on 5.5.10194
Scott  
#8 Posted : Tuesday, March 22, 2016 1:49:54 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,380
United States

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
My original docs were incorrect, I apologize for that. For several reasons this will require 5.5+ and I'll update the OP to reflect that.

Also, the request for information will be sent whenever the General tab is initialized per session. This happens when you switch between sessions while on the General tab or refresh the whole page. I'm working on more logic to better retrieve the information.

As far as the information being searchable, that's a bit problematic since it's technically just command results which isn't currently searchable. In theory it could be dumped into a Custom property to be searchable, but we'd have to assume one isn't in use and effectively hijack its use. Kind of a separate issue but I know it's a desired feature of this extension so I'm still working on it.
ScreenConnect Team
Scott  
#9 Posted : Thursday, March 31, 2016 2:42:31 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,380
United States

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
Updated to 1.1 to prevent command execution if user does not have RunCommandOutsideSession permission and to require ScreenConnect 5.5+ in order to function. Could be a few days before it hits the marketplace.
ScreenConnect Team
Matt Highsmith  
#10 Posted : Thursday, March 31, 2016 2:57:46 PM(UTC)
Matt Highsmith


Rank: Advanced Member

Medals: ScreenConnect Advisor: Focus Group MemberLevel 2: Lent a Helping Hand! 10 Thanks!

Joined: 4/1/2014(UTC)
Posts: 216
United States
Location: Raleigh

Thanks: 2 times
Was thanked: 15 time(s) in 11 post(s)
nice
Matt Highsmith  
#11 Posted : Thursday, March 31, 2016 7:59:01 PM(UTC)
Matt Highsmith


Rank: Advanced Member

Medals: ScreenConnect Advisor: Focus Group MemberLevel 2: Lent a Helping Hand! 10 Thanks!

Joined: 4/1/2014(UTC)
Posts: 216
United States
Location: Raleigh

Thanks: 2 times
Was thanked: 15 time(s) in 11 post(s)
new version is already available. thanks
wardrop  
#12 Posted : Wednesday, June 29, 2016 3:47:04 AM(UTC)
wardrop


Rank: Newbie

Joined: 7/9/2014(UTC)
Posts: 5
Australia

Thanks for this. Is it possible to create groups based on this new information? For example, it would be nice to be able to create a laptop's group by filtering on model, e.g. Model LIKE '%Latitude%'.
wardrop  
#13 Posted : Wednesday, June 29, 2016 6:31:46 AM(UTC)
wardrop


Rank: Newbie

Joined: 7/9/2014(UTC)
Posts: 5
Australia

Ok, so I've just looked at the extension code, and I now see that it's using the "command history" to store the details, hence why it's not searchable or anything.
tlucas  
#14 Posted : Monday, July 11, 2016 3:27:14 PM(UTC)
tlucas


Rank: Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 2/17/2015(UTC)
Posts: 22
United States

Thanks: 4 times
Was thanked: 3 time(s) in 2 post(s)
Originally Posted by: wardrop Go to Quoted Post
Thanks for this. Is it possible to create groups based on this new information? For example, it would be nice to be able to create a laptop's group by filtering on model, e.g. Model LIKE '%Latitude%'.


Love the extension also, but was looking for the exact same thing that wardrop was looking for. I would love to be able to have a group based on the model of computer. Specifically the laptops. Is there another way of accomplishing this?
ddre  
#15 Posted : Wednesday, July 13, 2016 4:57:27 AM(UTC)
ddre


Rank: Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 7/1/2014(UTC)
Posts: 34
Australia
Location: Melbourne, Australia

Thanks: 6 times
Was thanked: 4 time(s) in 4 post(s)
How often does it refresh the data? Ive updated the BIOS on a few HP PCs but the listed version hasnt updated in a few days.
Scott  
#16 Posted : Wednesday, July 13, 2016 3:19:38 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,380
United States

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
@ddre It actually doesn't refresh the data, but you can manually do so by running the following command against the machine from the Command tab on the Host page:

Code:

#!ps 
#maxlength=100000 
#timeout=90000 
echo "INFORMATIONREQUEST-RESPONSE/1" 
echo "CommandType: General" 
echo "ContentType: xml" 
echo "" $Host.UI.RawUI.BufferSize = New-Object Management.Automation.Host.Size (500, 25) 
$computer = get-wmiobject win32_computersystem | select Manufacturer, Model 
$bios = get-wmiobject win32_bios | select Name, SerialNumber 
write-output $computer.Manufacturer, $computer.Model, $bios.Name, $bios.SerialNumber| ConvertTo-Xml -As Stream
ScreenConnect Team
Konceptech.net  
#17 Posted : Friday, July 15, 2016 12:50:16 PM(UTC)
Konceptech.net


Rank: Advanced Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 7/26/2013(UTC)
Posts: 69
Canada
Location: Quebec

Thanks: 10 times
Was thanked: 3 time(s) in 2 post(s)
Informations is not available on version 6.

But the scripts seems to work, so probably a UI problem inside SC, not related to the extension.
Scott  
#18 Posted : Tuesday, July 19, 2016 12:53:36 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,380
United States

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
Version 1.2 is now available and should work in both 5.5+ and 6.0.

Edited by user Wednesday, July 20, 2016 12:43:02 PM(UTC)  | Reason: Not specified

ScreenConnect Team
KBrownConsulting  
#19 Posted : Wednesday, July 20, 2016 2:23:10 AM(UTC)
KBrownConsulting


Rank: Advanced Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 3/11/2014(UTC)
Posts: 69
United States

Thanks: 13 times
Was thanked: 8 time(s) in 5 post(s)
Just to clarify, when you say 5.x you really mean 5.5+ right? I see nothing in 5.3
Scott  
#20 Posted : Wednesday, July 20, 2016 12:42:41 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,380
United States

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
@KBrownConsulting yes, sorry about that. 5.5+, I'll edit my previous post to reflect that. Thanks for catching it!
ScreenConnect Team
ddre  
#21 Posted : Wednesday, August 3, 2016 7:28:38 AM(UTC)
ddre


Rank: Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 7/1/2014(UTC)
Posts: 34
Australia
Location: Melbourne, Australia

Thanks: 6 times
Was thanked: 4 time(s) in 4 post(s)
This is no longer working on Win 10 14393.
chaberman  
#22 Posted : Tuesday, August 23, 2016 4:07:05 PM(UTC)
chaberman


Rank: Newbie

Joined: 1/22/2015(UTC)
Posts: 9
United States
Location: Carbondale, IL

What permissions do users need for this extension to work? When logged in as an administrator the extension performs as expected and populates all the fields however when I am logged in as a regular "host" user none of the fields populate. I also noticed that I can use the run command tab as the administrator but I can't use the run command when I am logged in as a regular host. I noticed this as I was trying to run the commands you mentioned above manually and I can't input anything into the run command box as a normal "host" user. Love 6.0 by the way, big improvements all around and looks slick to boot.

Edited by user Tuesday, August 23, 2016 4:08:49 PM(UTC)  | Reason: Not specified

Scott  
#23 Posted : Tuesday, August 23, 2016 4:18:17 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,380
United States

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
Glad to hear you're liking 6.0!

Also, this extension requires the RunCommandOutsideSession permission applied to the session(s) against which you want the user to be able to run the command.
ScreenConnect Team
chaberman  
#24 Posted : Tuesday, August 23, 2016 4:21:40 PM(UTC)
chaberman


Rank: Newbie

Joined: 1/22/2015(UTC)
Posts: 9
United States
Location: Carbondale, IL

Originally Posted by: Scott Go to Quoted Post
Glad to hear you're liking 6.0!

Also, this extension requires the RunCommandOutsideSession permission applied to the session(s) against which you want the user to be able to run the command.


Is there a way to apply this permission to all sessions globally including newly created sessions?
Scott  
#25 Posted : Tuesday, August 23, 2016 4:23:35 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,380
United States

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
Yes, you can setup the permission similar to the following:

Code:

RunCommandOutsideSession: AllSessionGroups, OwnedAndUnowned
ScreenConnect Team
chaberman  
#26 Posted : Tuesday, August 23, 2016 6:35:04 PM(UTC)
chaberman


Rank: Newbie

Joined: 1/22/2015(UTC)
Posts: 9
United States
Location: Carbondale, IL

Originally Posted by: Scott Go to Quoted Post
RunCommandOutsideSession: AllSessionGroups, OwnedAndUnowned


Sorry for being daft but where does this go exactly? Do I set this in the administration settings somewhere?
Scott  
#27 Posted : Tuesday, August 23, 2016 7:13:05 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,380
United States

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
Try the Security tab on the Administration page. This KB article has more information.
ScreenConnect Team
chaberman  
#28 Posted : Tuesday, August 23, 2016 9:19:58 PM(UTC)
chaberman


Rank: Newbie

Joined: 1/22/2015(UTC)
Posts: 9
United States
Location: Carbondale, IL

Originally Posted by: Scott Go to Quoted Post
Try the Security tab on the Administration page. This KB article has more information.

Thanks that did it!

Edited by user Tuesday, August 23, 2016 9:20:54 PM(UTC)  | Reason: Not specified

kappa  
#29 Posted : Thursday, August 25, 2016 6:53:35 PM(UTC)
kappa


Rank: Newbie

Joined: 4/24/2015(UTC)
Posts: 3
United States
Location: Florida

Scott -

Any chance that this Extension could be modified to store the data fields in the database so its retained and searchable. Similar to all the original details on the General Tab (EX: Windows, CPU, Memory).

A second request is to have the process execute at the same time you poll for the rest of the General Tab details. Im not sure how or when that happens but the basic Windows version, CPU, Memory are always available even if the machine is powered off.

There are many times we need to search for data and times that we need the data but the machine is powered off and the fields have not populated yet.

We run database maintenance that clears the Commands every 30 days. We may be causing our own issues for the missing data.
Scott  
#30 Posted : Wednesday, August 31, 2016 1:09:10 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,380
United States

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
Right now Command results aren't searchable, but I suppose the Extension could write the output into a Note. Notes would also be deleted by the maintenance plan, but it could also ensure that it's present and re-add if necessary.

I'll add this to my to-do list for this Extension, thanks!
ScreenConnect Team
rjodwyer  
#31 Posted : Wednesday, January 4, 2017 3:17:07 AM(UTC)
rjodwyer


Rank: Newbie

Joined: 5/13/2011(UTC)
Posts: 3
Location: Melbourne, Australia

Will this extension be updated to pull info from Windows 10 Anniversary update and beyond?

Or is there a workaround command to pull the info back into ScreenConnect?

Currently no info is returned for any powershell function it seems, the only output is this:

INFORMATIONREQUEST-RESPONSE/1
CommandType: General Content
Type: xml

Thanks,
Ryan
Scott  
#32 Posted : Wednesday, January 4, 2017 2:01:52 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,380
United States

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
@rjodwyer that fix required a change to the core code, thus it cannot be fixed within the extension. The fix itself is included in version 6.1, which is still a pre-release.
ScreenConnect Team
thanks 1 user thanked Scott for this useful post.
silversword on 1/4/2017(UTC)
chriscamp  
#33 Posted : Tuesday, January 17, 2017 7:43:05 PM(UTC)
chriscamp


Rank: Newbie

Joined: 1/28/2016(UTC)
Posts: 10

I really like the extension and wanted to share how easy it is to pull additional information using some WMI queries. The code below adds Domain Name, DHCP Enabled,DHCP Server, Internal IP Address, and Default Gateway to the view.

var hasSentCommand = false;

SC.event.addGlobalHandler(SC.event.InitializeTab, function (eventArgs) {
if (isGeneralTab(eventArgs.tabName)){
hasSentCommand = false;
//var descriptionList = SC.ui.findDescendentByTag(eventArgs.container, "dl");
var descriptionList = eventArgs.container.firstChild;
SC.ui.addElement(descriptionList, 'dt', {id: 'modelContainer', innerHTML: 'Model :'});
SC.ui.addElement(descriptionList, 'dd', {id: 'modelValueContainer'});
SC.ui.addElement(descriptionList, 'dt', {id: 'manufacturerContainer', innerHTML: 'Manufacturer:'});
SC.ui.addElement(descriptionList, 'dd', {id: 'manufacturerValueContainer'});
SC.ui.addElement(descriptionList, 'dt', {id: 'biosNameContainer', innerHTML: 'BIOS Name:'});
SC.ui.addElement(descriptionList, 'dd', {id: 'biosNameValueContainer'});
SC.ui.addElement(descriptionList, 'dt', {id: 'biosSerialContainer', innerHTML: 'BIOS Serial:'});
SC.ui.addElement(descriptionList, 'dd', {id: 'biosSerialValueContainer'});
SC.ui.addElement(descriptionList, 'dt', {id: 'domainNameContainer', innerHTML: 'Domain:'});
SC.ui.addElement(descriptionList, 'dd', {id: 'domainNameValueContainer'});
SC.ui.addElement(descriptionList, 'dt', {id: 'DHCPEnabledContainer', innerHTML: 'DHCP Enabled:'});
SC.ui.addElement(descriptionList, 'dd', {id: 'DHCPEnabledValueContainer'});
SC.ui.addElement(descriptionList, 'dt', {id: 'DHCPServerContainer', innerHTML: 'DHCP Server:'});
SC.ui.addElement(descriptionList, 'dd', {id: 'DHCPServerValueContainer'});
SC.ui.addElement(descriptionList, 'dt', {id: 'internalIPAddressContainer', innerHTML: 'Internal IP Address:'});
SC.ui.addElement(descriptionList, 'dd', {id: 'internalIPAddressValueContainer'});
SC.ui.addElement(descriptionList, 'dt', {id: 'defaultGatewayContainer', innerHTML: 'Default Gateway:'});
SC.ui.addElement(descriptionList, 'dd', {id: 'defaultGatewayValueContainer'});
}
});

SC.event.addGlobalHandler(SC.event.RefreshTab, function (eventArgs) {
if (isGeneralTab(eventArgs.tabName)) {
SC.ui.clear($('modelValueContainer'));
SC.ui.clear($('manufacturerValueContainer'));
SC.ui.clear($('biosNameValueContainer'));
SC.ui.clear($('biosSerialValueContainer'));
SC.ui.clear($('domainNameValueContainer'));
SC.ui.clear($('DHCPEnabledValueContainer'));
SC.ui.clear($('DHCPServerValueContainer'));
SC.ui.clear($('internalIPAddressValueContainer'));
SC.ui.clear($('defaultGatewayValueContainer'));
}

if (isSupportedOperatingSystem(eventArgs.session.GuestOperatingSystemName))
displayInformationRequest(
getLatestInformationRequestEvent(
eventArgs.sessionDetails,
eventArgs.tabName
), eventArgs
);
});

function isSupportedOperatingSystem(operatingSystemName){
if (operatingSystemName.startsWith("Windows") || operatingSystemName.startsWith("Microsoft"))
return true;
else
return false;
}

function sendCommand() {
window.addEventToSessions(
window.getSessionGroupUrlPart()[0],
SC.types.SessionType.Access,
[window.getSessionUrlPart()],
SC.types.SessionEventType.QueuedCommand,
null,
getInputCommand(
"General"
),
false,
false,
true
);
}

function getInputCommand(commandType) {
var headers = getHeaders();
headers.CommandType = commandType;
var commandText = "$computer = get-wmiobject win32_computersystem | select Manufacturer, Model, Domain" + "\n" +
"$bios = get-wmiobject win32_bios | select Name, SerialNumber" + "\n" +
"$network = get-wmiobject Win32_NetworkAdapterConfiguration |Where {$_.ipaddress -notlike $null}| select DHCPEnabled, DHCPServer,IPAddress, DefaultIPGateway" + "\n" +
"write-output $computer.Manufacturer, $computer.Model, $bios.Name, $bios.SerialNumber, $computer.Domain, $network.DHCPEnabled, $network.DHCPServer, $network.IPAddress, $network.DefaultIPGateway| ConvertTo-Xml -As Stream";

var emptyLinePrefix = '';

if (headers.Processor == 'sh')
emptyLinePrefix = 'echo ';
else{
emptyLinePrefix = 'echo ""';
commandText = "$Host.UI.RawUI.BufferSize = New-Object Management.Automation.Host.Size (500, 25)" + "\n" + commandText;
}

return "#!" + headers.shaBang + "\n" +
"#maxlength=100000" + "\n" +
"#timeout=90000" + "\n" +
headers.modifier + "INFORMATIONREQUEST-RESPONSE/1" + headers.delimiter + "\n" +
headers.modifier + "CommandType: " + headers.CommandType + headers.delimiter + "\n" +
headers.modifier + "ContentType: " + headers.ContentType + headers.delimiter + "\n" +
emptyLinePrefix + "\n" + commandText;
}

function getHeaders() {
return { Processor: "ps", Interface: "powershell", ContentType: "xml", shaBang: "ps", modifier: "echo \"", delimiter: '\"' };
}

function isGeneralTab(tabName) {
switch (tabName) {
case 'General':
return true;
default:
return false;
}
}

function isInformationRequestContent(eventData) {
return eventData.startsWith("INFORMATIONREQUEST-RESPONSE/1");
}

function getLatestInformationRequestEvent(sessionDetails, CommandEventType) {
return sessionDetails.Connections
.map(function(c) { return c.Events; })
.reduce(function(outputArray, events) { Array.prototype.push.apply(outputArray, events); return outputArray; }, [])
.filter(function(e) {
return e.EventType === SC.types.SessionEventType.RanCommand &&
isInformationRequestContent(e.Data)
})
.sort(function (x, y) { return x.Time - y.Time; })
[0];
}

function parseDataHeaders(eventData) {
var currentIndex = 0;
var headers = {};
var isStatusLine = true;

while (true) {
var nextNewLineIndex = eventData.indexOf('\n', currentIndex);

if (isStatusLine) {
isStatusLine = false;
} else if (nextNewLineIndex == currentIndex + 2 || nextNewLineIndex < 0) {
break;
} else {
var lineParts = eventData.substring(currentIndex, nextNewLineIndex).split(': ');
headers[lineParts[0]] = lineParts[1];
}
currentIndex = nextNewLineIndex + 1;
}
return headers;
}

function displayInformationRequest(latestCommandEvent, eventArgs) {
if (typeof latestCommandEvent === 'undefined' && !hasSentCommand && window.isCommandEnabled("RunCommand", null, [eventArgs.session], eventArgs.session.Permissions)) {
sendCommand();
hasSentCommand = true;
return;
} else {
var headers = parseDataHeaders(latestCommandEvent.Data);
displayCommandData(getEventDataXml(latestCommandEvent.Data));
}
}

function getEventDataXml(eventData) {
return parseXml(eventData.substring(eventData.indexOf('<?xml'), eventData.length));
}

function displayCommandData(xml) {
var x = xml.getElementsByTagName("Object");
if (isUsingInternetExplorerOrEdge())
{
$('manufacturerValueContainer').innerHTML = x[0].childNodes[0].textContent;
$('modelValueContainer').innerHTML = x[1].childNodes[0].textContent;
$('biosNameValueContainer').innerHTML = x[2].childNodes[0].textContent;
$('biosSerialValueContainer').innerHTML = x[3].childNodes[0].textContent;
$('domainNameValueContainer').innerHTML = x[4].childNodes[0].textContent;
$('DHCPEnabledValueContainer').innerHTML = x[5].childNodes[0].textContent;
$('DHCPServerValueContainer').innerHTML = x[6].childNodes[0].textContent;
$('internalIPAddressValueContainer').innerHTML = x[7].childNodes[0].textContent;
$('defaultGatewayValueContainer').innerHTML = x[8].childNodes[0].textContent;
} else {
$('manufacturerValueContainer').innerHTML = x[0].innerHTML;
$('modelValueContainer').innerHTML = x[1].innerHTML;
$('biosNameValueContainer').innerHTML = x[2].innerHTML;
$('biosSerialValueContainer').innerHTML = x[3].innerHTML;
$('domainNameValueContainer').innerHTML = x[4].innerHTML;
$('DHCPEnabledValueContainer').innerHTML = x[5].innerHTML;
$('DHCPServerValueContainer').innerHTML = x[6].innerHTML;
$('internalIPAddressValueContainer').innerHTML = x[7].innerHTML;
$('defaultGatewayValueContainer').innerHTML = x[8].innerHTML;
}
}


function parseXml(xml) {
var dom = null;
if (window.DOMParser) {
try {
dom = (new DOMParser()).parseFromString(xml, "text/xml");
}
catch (e) { dom = null; }
}
else if (window.ActiveXObject) {
try {
dom = new ActiveXObject('Microsoft.XMLDOM');
dom.async = false;
if (!dom.loadXML(xml)) // parse error ..
window.alert(dom.parseError.reason + dom.parseError.srcText);
}
catch (e) { dom = null; }
}
else
alert("cannot parse xml string!");
return dom;
}

function isUsingInternetExplorerOrEdge() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf("Trident");

if (ua.indexOf("Trident") > 0 || ua.indexOf("Edge") > 0)
return true;
else
return false;
}
shawnkhall  
#34 Posted : Wednesday, January 18, 2017 9:04:21 AM(UTC)
shawnkhall


Rank: Advanced Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 2/6/2014(UTC)
Posts: 158
Man
United States

Thanks: 5 times
Was thanked: 8 time(s) in 6 post(s)
@Scott, you mentioned 5 months ago that you'd alter the behavior for this extension so that it would store the results in a Note. Have you made any progress on that? I'm wanting to accomplish something similar and could use a code sample for storing a command result in a note.
Scott  
#35 Posted : Wednesday, January 18, 2017 5:11:17 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,380
United States

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
@shawnkhall 6.2 will include a change to the DB maintenance definitions that will make this process significantly easier/more robust and I have been holding off for that change.

Although a js function to add 'data' as a Note to an Access session would look like:
Code:

window.addEventToSessions(
		window.getSessionGroupUrlPart()[0], 
		SC.types.SessionType.Access,
		[window.getSessionUrlPart()], 
		SC.types.SessionEventType.AddedNote, 
		null,
		"data",
		false,
		false,
		true
	);
ScreenConnect Team
shawnkhall  
#36 Posted : Saturday, April 29, 2017 5:59:29 AM(UTC)
shawnkhall


Rank: Advanced Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 2/6/2014(UTC)
Posts: 158
Man
United States

Thanks: 5 times
Was thanked: 8 time(s) in 6 post(s)
Hi, Scott!

Now that 6.2 is released, will there be an update to this extension to use Notes instead of a CustomProperty?
Scott  
#37 Posted : Tuesday, May 2, 2017 10:22:41 AM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,380
United States

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
@shawnkhall unfortunately I haven't had a second to revisit this, but I hope to do so soon. It is still on my to-do list and I'll try to rearrange some other items so I have a moment to work on this sooner. Thanks for the reminder!
ScreenConnect Team
wardrop  
#38 Posted : Wednesday, May 10, 2017 2:18:36 AM(UTC)
wardrop


Rank: Newbie

Joined: 7/9/2014(UTC)
Posts: 5
Australia

Also keen for the updated extension. Thanks Scott.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.