Category Archives: Scripting

How to assign computer startup scripts?

1. Open the Group Policy snap-in. 2. In the console tree, click Scripts (Startup/Shutdown). – Where? policy name Policy > Computer Configuration > Windows Settings > Scripts (Startup/Shutdown)or Start the policy editor of the local group: Start Menu > Run > Type gpedit.msc 3. In the details pane, double-click Startup. 4. In the Startup Properties… Read More »

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… Read More »

Script to list the clients in descending access date order

  Write a script to list the clients in descending access date order (for deleting obsolete clients).   #!/usr/bin/ruby require “P4” p4 = P4.new p4.tagged p4.connect clients = p4.run_clients.sort {|a,b| a[ “Access”].to_i <=> b[“Access”].to_i } clients[0…10].each do |c| stamp = Time.at( c[ “Access” ].to_i ) printf( “%-20s %s\n”, c[ “client” ], stamp ) end OR… Read More »