lib/puppet_x/lsp/security_policy.rb
# collect all the local accounts using wmic
collect all the local accounts using wmic
collect all the local accounts using wmic
def local_accounts
        ary = []
        ["useraccount","group"].each do |lu|
            wmic([lu, 'where', "(domain=\"#{ENV["COMPUTERNAME"]}\")", 'get', 'name,sid', '/format:csv']).split("\n").each do |line|
                next if line =~ /Node/
                if line.include? ","
                    ary << line.strip.split(",")
                end
            end
        end
        ary
    end
def local_accounts ary = [ ] [ "useraccount" , "group" ] . each do | lu | wmic ( [ lu , 'where' , "(domain=\"#{ENV["COMPUTERNAME"]}\")" , 'get' , 'name,sid' , '/format:csv' ] ) . split ( "\n" ) . each do | line | next if line =~ / Node / if line . include? "," ary << line . strip . split ( "," ) end end end ary end
collect all the local accounts using wmic
collect all the local accounts using wmic