如何使用 Javascript 获取服务管理器的许可证信息
How to get License info for Service Manager using Javascript
我需要使用 scriptLibrary 而不是使用 GUI 获取我的 SM 许可组件。是否有 table 可以让我执行搜索或以其他方式获取该信息的地方?任何建议都会有所帮助。
您可以使用下一个功能来获取与您的许可相关的一些信息:
function getLicenseInfo() {
var license = system.functions.get_module_license();
for (var i in license) {
var module = system.functions.strraw(license[i], ",");
var module1 = module.split(",");
if (module1[0] == "Self Service Ticketing") {
print(module1[0] + " " + module1[2] + "(Unlimited)");
} else {
print(module1[0] + " Named License " + module1[1] + "(" + module1[3] + ")" + " Float License " + module1[2] + "(" + module1[4] + ")");
}
}
}
您的输出可能如下所示:
Smart Analytics Named License 0(0) Float License 0(0)
Asset Contract Management Named License 0(140) Float License 1(140)
Scheduled Maintenance Named License 0(1890) Float License 0(70)
Problem Management Named License 0(1890) Float License 1(70)
Contract Management Named License 0(140) Float License 0(140)
SLA Named License 0(1890) Float License 1(70)
Service Desk Named License 0(1890) Float License 1(70)
Login License Named License 1(1890) Float License 0(70)
Request Management Named License 0(140) Float License 1(70)
Change Management Named License 0(1820) Float License 1(0)
Configuration Management Named License 0(1890) Float License 1(70)
Incident Management Named License 0(1890) Float License 1(70)
IR Expert Named License 0(1890) Float License 0(70)
Self Service Ticketing 0(Unlimited)
Service Catalog Named License 0(70070) Float License 0(0)
RAD Compiler Named License 0(0) Float License 0(0)
我需要使用 scriptLibrary 而不是使用 GUI 获取我的 SM 许可组件。是否有 table 可以让我执行搜索或以其他方式获取该信息的地方?任何建议都会有所帮助。
您可以使用下一个功能来获取与您的许可相关的一些信息:
function getLicenseInfo() {
var license = system.functions.get_module_license();
for (var i in license) {
var module = system.functions.strraw(license[i], ",");
var module1 = module.split(",");
if (module1[0] == "Self Service Ticketing") {
print(module1[0] + " " + module1[2] + "(Unlimited)");
} else {
print(module1[0] + " Named License " + module1[1] + "(" + module1[3] + ")" + " Float License " + module1[2] + "(" + module1[4] + ")");
}
}
}
您的输出可能如下所示:
Smart Analytics Named License 0(0) Float License 0(0)
Asset Contract Management Named License 0(140) Float License 1(140)
Scheduled Maintenance Named License 0(1890) Float License 0(70)
Problem Management Named License 0(1890) Float License 1(70)
Contract Management Named License 0(140) Float License 0(140)
SLA Named License 0(1890) Float License 1(70)
Service Desk Named License 0(1890) Float License 1(70)
Login License Named License 1(1890) Float License 0(70)
Request Management Named License 0(140) Float License 1(70)
Change Management Named License 0(1820) Float License 1(0)
Configuration Management Named License 0(1890) Float License 1(70)
Incident Management Named License 0(1890) Float License 1(70)
IR Expert Named License 0(1890) Float License 0(70)
Self Service Ticketing 0(Unlimited)
Service Catalog Named License 0(70070) Float License 0(0)
RAD Compiler Named License 0(0) Float License 0(0)