Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

winusers plugin incorrect display languege

winusers plugin incorrect display languege or fonts

Server information

Operating system

  • OS Name :
  • Version :
  • RAM installed :
  • Free RAM :
  • CPU :
  • Distribution :
  • Linux x86_64
  • 3.10.0-957.12.2.el7.x86_64
  • 991 MB
  • 245 MB
  • Intel(R) Xeon(R) CPU E7- 4860 @ 2.27GHz
  • CentOS Linux 7 (Core)

Software

  • PHP Version :
  • Web Server :
  • Database Server :
  • Version OCSReports:
  • 7.3.5
  • Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.3.5 mod_perl/2.0.10 Perl/v5.16.3
  • MariaDB Server version 10.3.15-MariaDB
  • 2.7

in OCS Inventory NG plugins by (800 points)

17 Answers

0 votes

OCS Inventory Agent 2.4.0.0       

Regards

by (800 points)
0 votes
Ok. ocs agent is executed under system account (admin rights). For me there is no problem.
by (90.4k points)
0 votes

ok.but there is still error in log 

WARNING *** EXECUTABLE PLUGIN => Executable plugin <C:\Program Files (x86)\OCS Inventory Agent\plugins\winusers.ps1> output is not UTF-8 encoded or an XML document, trying to UTF-8 encode

WARNING *** EXECUTABLE PLUGIN => Executable plugin <C:\Program Files (x86)\OCS Inventory Agent\plugins\winusers.ps1> output encoded to UTF-8, trying to reload XML document

ERROR *** EXECUTABLE PLUGIN => Executable plugin <C:\Program Files (x86)\OCS Inventory Agent\plugins\winusers.ps1> output is not a valid XML document

by (800 points)
0 votes
Post here the content of the script you use.
by (90.4k points)
0 votes

function Get-AdminUser {

param([string] $username)

$admingroup = Get-LocalGroupMember -Group "Administrateurs"

$userType = "Local user"

foreach ($admin in $admingroup) {

$name = $admin.name -split "\\"

if($name[1] -eq $username){

$userType = "Admin user"

}

}

return $userType

}

function Get-Size

{

param([string]$pth)

"{0:n2}" -f ((gci -path $pth -recurse | measure-object -property length -sum).sum /1mb)

}

$users = Get-LocalUser | Select *

foreach ($user in $users) {

if($user.Name -ne $null){

$userType = Get-AdminUser $user.Name

$path = "C:\Users\"+ $user.Name

$folderSize = Get-Size $path

if($user.Enabled -ne "False") { $userStatus = "Disabled" } else { $userStatus = "Enabled" }

$xml += "<WINUSERS>`n"

$xml += "<NAME>"+ $user.Name +"</NAME>`n"

$xml += "<TYPE>"+ $userType +"</TYPE>`n"

$xml += "<SIZE>"+ $folderSize +"</SIZE>`n"

$xml += "<LASTLOGON>"+ $user.LastLogon +"</LASTLOGON>`n"

$xml += "<DESCRIPTION>"+ $user.Description +"</DESCRIPTION>`n"

$xml += "<STATUS>"+ $userStatus +"</STATUS>`n"

$xml += "<USERMAYCHANGEPWD>"+ $user.UserMayChangePassword +"</USERMAYCHANGEPWD>`n"

$xml += "<PASSWORDEXPIRES>"+ $user.PasswordExpires +"</PASSWORDEXPIRES>`n"

$xml += "<SID>"+ $user.SID +"</SID>`n"

$xml += "</WINUSERS>`n"

}

}

[Console]::OutputEncoding = [System.Text.Encoding]::UTF8

[Console]::WriteLine($xml)

by (800 points)
0 votes
The script has been updated. Try it. Download the latest archive.

Regards

Frank
by (90.4k points)
0 votes

using this powershell 

function Get-AdminUser {

param([string] $username)

$admingroup = Get-LocalGroupMember -Group "Administrateurs"

$userType = "Local user"

foreach ($admin in $admingroup) {

$name = $admin.name -split "\\"

if($name[1] -eq $username){

$userType = "Admin user"

}

}

return $userType

}

function Get-Size

{

param([string]$pth)

"{0:n2}" -f ((gci -path $pth -recurse | measure-object -property length -sum).sum /1mb)

}

$users = Get-LocalUser | Select *

foreach ($user in $users) {

if($user.Name -ne $null){

$userType = Get-AdminUser $user.Name

$path = "C:\Users\"+ $user.Name

$folderSize = Get-Size $path

if($user.Enabled -ne "False") { $userStatus = "Disabled" } else { $userStatus = "Enabled" }

$xml += "<WINUSERS>"

$xml += "<NAME>"+ $user.Name +"</NAME>"

$xml += "<TYPE>"+ $userType +"</TYPE>"

$xml += "<SIZE>"+ $folderSize +"</SIZE>"

$xml += "<LASTLOGON>"+ $user.LastLogon +"</LASTLOGON>"

$xml += "<DESCRIPTION>"+ $user.Description +"</DESCRIPTION>"

$xml += "<STATUS>"+ $userStatus +"</STATUS>"

$xml += "<USERMAYCHANGEPWD>"+ $user.UserMayChangePassword +"</USERMAYCHANGEPWD>"

$xml += "<PASSWORDEXPIRES>"+ $user.PasswordExpires +"</PASSWORDEXPIRES>"

$xml += "<SID>"+ $user.SID +"</SID>"

$xml += "</WINUSERS>"

}

}

[Console]::OutputEncoding = [System.Text.Encoding]::UTF8

[Console]::WriteLine($xml)

get this in ocsinventory log
EXECUTABLE PLUGIN => Plugin <teamviewer.vbs> executed successfully
EXECUTABLE PLUGIN => Found executable plugin <uptime.vbs>
EXECUTABLE PLUGIN => Plugin <uptime.vbs> executed successfully
EXECUTABLE PLUGIN => Found executable plugin <winupdate.vbs>
EXECUTABLE PLUGIN => Plugin <winupdate.vbs> executed successfully
EXECUTABLE PLUGIN => Searching for PS1 script(s) in folder <C:\Program Files (x86)\OCS Inventory Agent\plugins>
EXECUTABLE PLUGIN => Found executable plugin <services.ps1>
EXECUTABLE PLUGIN => Plugin <services.ps1> executed successfully
EXECUTABLE PLUGIN => Found executable plugin <winusers.ps1>
WARNING *** EXECUTABLE PLUGIN => Executable plugin <C:\Program Files (x86)\OCS Inventory Agent\plugins\winusers.ps1> output is not UTF-8 encoded or an XML document, trying to UTF-8 encode
WARNING *** EXECUTABLE PLUGIN => Executable plugin <C:\Program Files (x86)\OCS Inventory Agent\plugins\winusers.ps1> output encoded to UTF-8, trying to reload XML document
ERROR *** EXECUTABLE PLUGIN => Executable plugin <C:\Program Files (x86)\OCS Inventory Agent\plugins\winusers.ps1> output is not a valid XML document
AGENT => Sending Inventory
by (800 points)
 
Powered by Question2Answer
...