SPservice.UserGroup usergroup = new SPservice.UserGroup();
usergroup.Credentials = System.Net.CredentialCache.DefaultCredentials;
XmlNode allusers = usergroup.GetAllUserCollectionFromWeb();
foreach (XmlNode child in allusers.ChildNodes) {
foreach (XmlNode item in child) {
foreach (XmlAttribute atr in item.Attributes) {
if (atr.Name.ToString() == "LoginName") {
MessageBox.Show(atr.OuterXml);
}
}
}
}
SPservice - name of web reference in your visual studio project with URL:
http://<your server name>
No comments:
Post a Comment