Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

A script to find all users who have not set passwords

a-script-to-find-all-users-who-have-not-set-passwords

a-script-to-find-all-users-who-have-not-set-passwords

Write a script to find all users who have not set passwords.

#!/usr/bin/ruby
require “P4”
p4 = P4.new
p4.parse_forms
p4.connect
p4.run_users.each do
|u|
user = p4.fetch_user( u[ “User” ] )
puts( user[ “User” ] ) unless user.has_key?( “Password” )
end
#!/

OR

#!/usr/bin/perl
use P4;
my $p4 = new P4;
$p4->ParseForms();
$p4->Init() or die( “Can’t connect to Perforce” );
foreach my $u ( $p4->Users() )
{
my $user = $p4->FetchUser( $u->{ “User” } );
print( $user->{ “User” }, “\n” ) unless defined ( $user->{ “Password” }
);
}

Rajesh Kumar
Follow me
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x