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
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