/// <summary> /// Process record. /// </summary> protected override void ProcessRecord() { AuthZHandleCallbackAce callback = null; if (CallbackAceScriptBlock != null) { callback = a => PSUtils.InvokeWithArg(CallbackAceScriptBlock, false, a); } WriteObject(AuthZResourceManager.Create(Name, Flags, callback)); }
/// <summary> /// Process record. /// </summary> protected override void ProcessRecord() { if (ParameterSetName == "LocalRM") { AuthZHandleCallbackAce callback = null; if (CallbackAceScriptBlock != null) { callback = a => PSUtils.InvokeWithArg(CallbackAceScriptBlock, false, a); } WriteObject(AuthZResourceManager.Create(Name, Flags, callback)); } else { WriteObject(AuthZResourceManager.Create(Server, ServerSpn, ServiceType)); } }
/// <summary> /// Create a new AuthZ resource manager. /// </summary> /// <param name="name">The name of the resource manager, optional.</param> /// <param name="flags">Optional flags for the resource manager.</param> /// <param name="handle_callback_ace">Optional callback to handle callback ACEs.</param> /// <returns>The created AuthZ resource manager.</returns> public static AuthZResourceManager Create(string name, AuthZResourceManagerInitializeFlags flags, AuthZHandleCallbackAce handle_callback_ace) { return(Create(name, flags, handle_callback_ace, true).Result); }
/// <summary> /// Create a new AuthZ resource manager. /// </summary> /// <param name="name">The name of the resource manager, optional.</param> /// <param name="flags">Optional flags for the resource manager.</param> /// <param name="handle_callback_ace">Optional callback to handle callback ACEs.</param> /// <param name="throw_on_error">True to throw on error.</param> /// <returns>The created AuthZ resource manager.</returns> public static NtResult <AuthZResourceManager> Create(string name, AuthZResourceManagerInitializeFlags flags, AuthZHandleCallbackAce handle_callback_ace, bool throw_on_error) { AuthZResourceManager ret = new AuthZResourceManager(name); AuthzAccessCheckCallback callback = null; if (handle_callback_ace != null) { ret._handle_callback_ace = handle_callback_ace; callback = ret.HandleCallbackAce; } return(SecurityNativeMethods.AuthzInitializeResourceManager(flags, callback, IntPtr.Zero, IntPtr.Zero, name, out ret._handle).CreateWin32Result(throw_on_error, () => ret)); }