How to add user to active directory group?
How can I add user to the Active Directory by the javascript code.
I have got a script which adding to Sharepoint Group, but how Could I do it with Active Directory Group:
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server"> <script type="text/ecmascript" language="ecmascript"> var user; var FlashGroup; function runCode() { var clientContext = new SP.ClientContext(); var groupCollection = clientContext.get_web().get_siteGroups(); FlashGroup = groupCollection.getByName('Group Sharepoint'); user = clientContext.get_web().get_currentUser(); var userCollection = FlashGroup.get_users(); userCollection.addUser(user); clientContext.load(user); clientContext.load(FlashGroup); clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceededZapisz), Function.createDelegate(this, this.onQueryFailed)); } function onQuerySucceededZapisz() { alert(user.get_title() + " został dodany do " + FlashGroup.get_title()); } function onQueryFailed(sender, args) { alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace()); } </script> <input id="Button11" type="button" class="Zapisz" value="Zapisz mnie do grupy" onclick="runCode()" /> </asp:Content>