samba-gpupdate: Change machine option to target
[nivanova/samba-autobuild/.git] / source4 / scripting / bin / samba-gpupdate
index 1a95d03c8adace893c54481addbf544ae93bf6b2..647acd9ada15368e7a6b551546baaa9a22ed47a7 100755 (executable)
@@ -49,8 +49,8 @@ if __name__ == "__main__":
     parser.add_option('-H', '--url', dest='url', help='URL for the samdb')
     parser.add_option('-X', '--unapply', help='Unapply Group Policy',
                       action='store_true')
-    parser.add_option('-M', '--machine', help='Apply machine policy',
-                      action='store_true', default=False)
+    parser.add_option('--target', default='Computer', help='{Computer | User}',
+                      choices=['Computer', 'User'])
     parser.add_option_group(credopts)
 
     # Set the options and the arguments
@@ -85,10 +85,10 @@ if __name__ == "__main__":
     store = GPOStorage(os.path.join(cache_dir, 'gpo.tdb'))
 
     gp_extensions = []
-    if opts.machine:
+    if opts.target == 'Computer':
         if lp.get('server role') == 'active directory domain controller':
             gp_extensions.append(gp_sec_ext(logger))
-    else:
+    elif opts.target == 'User':
         pass # User extensions
 
     # Get a live instance of Samba