mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
Add last login to WindowsUser
Signed-off-by: Mendy Baitelman <mendy@baitelman.com>
This commit is contained in:
parent
b9a55682dc
commit
8205a78fd2
1 changed files with 6 additions and 0 deletions
|
@ -223,6 +223,10 @@ module Inspec::Resources
|
|||
meta_info[:userflags] unless meta_info.nil?
|
||||
end
|
||||
|
||||
def lastlogin
|
||||
meta_info[:lastlogin] unless meta_info.nil?
|
||||
end
|
||||
|
||||
# returns the minimum days between password changes
|
||||
def mindays
|
||||
credentials[:mindays] unless credentials.nil?
|
||||
|
@ -632,6 +636,7 @@ module Inspec::Resources
|
|||
shell: res[:shell],
|
||||
domain: res[:domain],
|
||||
userflags: res[:userflags],
|
||||
lastlogin : res[:lastlogin]
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -715,6 +720,7 @@ module Inspec::Resources
|
|||
home = $_.HomeDirectory[0]
|
||||
shell = $null
|
||||
domain = $Computername
|
||||
lastlogin = if($_.lastlogin.getType().Tostring() -eq "System.Management.Automation.PSMethod" ){ $null }else{[String]$_.lastlogin}
|
||||
}
|
||||
} | ConvertTo-Json
|
||||
EOH
|
||||
|
|
Loading…
Reference in a new issue