There is an undocumented API /_vti_bin/homeapi.ashx/sites/followed that returns the list of followed sites for the currently logged in user. This one does not seem to be useful due to permission-related limitations.  There is also a Graph API endpoint: https://graph.microsoft.com/beta/users/Admin@Contoso.onmicrosoft.com/followedSites  But it gives me access denied:   PnP SharePoint PowerShell Script  $AppSecret = 'XXXXX*[ZLq9Q3VFOwXGRm2NSP' $appId = 'fb32c27b-XXXXX-4824-8af0-e8d303553d9e' $AADDomain = 'contosoTenant.onmicrosoft.com'  Connect-PnPOnline -AppId $AppId -AppSecret $AppSecret -AADDomain $AADDomain $accesstoken = Get-PnPAccessToken $response = Invoke-RestMethod -Uri 'https://graph.microsoft.com/beta/users/Admin@contosoTenant.onmicrosoft.com/followedSites' -ContentType "application/json" -Headers @{Authorization = "Bearer $accesstoken"} -Method Get   Permissions assigned to the AAD App:    Question   Is there a way to retrieve the list of followed sites for a specific user using REST API, Graph or some other way?   Explanation  We are going to need to write a crawler that runs every day and for every user in Office 365, gets the list of followed sites. This will later be used for a separate email notifications feature. But first, I am trying to understand if it's even possible to get users' followed sites.  Any help will be greatly appreciated!  Edit There is a , but we are using Office 365, which makes this question different.
123966
How to get another user's followed sites, programmatically.   It seems that SPSocialFollowingManager followingManager = new SPSocialFollowingManager(userProfile, context); only works for the current user; for another user it always returns null.  I have tried to run with elevated privileges and it can't get the result for even the current user.
115140
Is there a way to check if a file is checked out by another user? I am going trhough a list file by file and would like to avoid the "file is opened by another user" error. Something like this would be nice:  Guid id = new Guid(slideLibrary); // ID of Slide-Library. List list = ctx.Web.Lists.GetById(id); ListItemCollection items = list.GetItems(CamlQuery.CreateAllItemsQuery()); ctx.Load(items); // Loading all the fields System.Security.SecureString pwd = new System.Security.SecureString(); foreach (char c in "pwd".ToCharArray()) pwd.AppendChar(c);  ctx.Credentials = new SharePointOnlineCredentials(login, pwd); ctx.ExecuteQuery();  // Iterating through all the entries. foreach (var item in items) {     String currentID = item["ID"].ToString(); // Getting the ID of the current item.      if (!item.IsCheckedOut()) // This is the part I am looking for.     {        // Do stuff     }     else     {        Console.WriteLine("Item is blocked, skipping it.")     } }   I have yet not been able to find something fitting.
38008
I am trying to get the access token over a controller that is connected to a Salesforce site. But I am having the below error message:  System.CalloutException: Unauthorized endpoint, please check Setup-&gt;Security-&gt;Remote site settings. endpoint = https://sandbox-goku.cs87.force.com/services/oauth2/token   My controller:   public class Mycontroller {         public String accessToken {             private set;             get {                 if (accessToken == null) {                     accessToken = RestUtil.getAccessToken();                 }                  return accessToken;             }         }   }   Utility to get the access token:  public class RestUtil {     private transient static String accessToken = '';      public static String getAccessToken() {         if (accessToken == '') {             accessToken = fetchAccessToken();         }          return accessToken;     }      private static String fetchAccessToken() {         HttpRequest authReq = buildAutHttpRequest();          Http http = new Http();          HttpResponse authRes = http.send(authReq);          String accessToken = extractAccessToken(authRes);          return accessToken;     }      private static String extractAccessToken(HttpResponse authRes) {         Map&lt;String, Object&gt; authResult = (Map&lt;String, Object&gt;) JSON.deserializeUntyped(authRes.getBody());          return (String) authResult.get('access_token');     }      private static HttpRequest buildAutHttpRequest() {         HttpRequest authReq = new HttpRequest();         authReq.setEndpoint('https://' + URL.getSalesforceBaseUrl().getHost() + '/services/oauth2/token');         authReq.setMethod('POST');         authReq.setBody(buildAuthRequestBody());          return authReq;     }      private static String buildAuthRequestBody() {         String template = 'grant_type=password&amp;username={0}&amp;password={1}&amp;client_id={2}&amp;client_secret={3}';         String[] arguments = new String[]{                 AdminAuthContants.USER_NAME,                 AdminAuthContants.PASSWORD,                 AdminAuthContants.CLIENT_ID,                 AdminAuthContants.CLIENT_SECRET         };          return String.format(template, arguments);     } }
12369
I currently use the   to retrieve data from several SharePoint lists.  This is my current preferred method of coding my way from ASP.NET and WinForms to retrieve this data.   My only issue with this project:  I have to manually generate the SPML file and add this to the development environment, compile it in the project, and only then I am able to use it to connect to the List.  This is great for projects that require connecting to the one and the same list always.  But I am having users creating new workspaces (sites) with each its own List from which I want to retrieve data automagically (same as linq to sharepoint does, but not statically).  Can you recommend your preferred way of accessing data from several SharePoint Lists and sites in C# WinForms and/or ASP.NET outside an actual SharePoint environment where I can specify the a new source site and list at run time?
111387
I have a WP Multisite / Multi Network installation. What I need is to redirect all non-logged and also all logged in users, except logged in network administrators, from the main site example.com (including all nested pages, posts, categories etc.) to the subsite.example.com, that is a segregated multisite network. They share the same database. The network administrator will have access to the main site only after they will log in on the subsite.example.com. In this way, only the logged in network administrators must have access to the main site example.com.  UPDATE  The @seamus-leahy solution works, but only partially. I use his function in a multisite multi-networks installation and all networks in this configuration works like separated WP installations, so the network example.com will not recognize and log in automatically the network administrator when he/she is already logged in on the subsite.example.com (network 2), but logged out from the example.com (network 1). This means that the network administrator, in this context, also cannot access the main network example.com. How to solve this?
45949
Using the sharing or dscl commands I can not figure out how to add users associated to shares. The current local-admin account has access to all shares, but I'd like to add a different user account the ability to access some of the AFP shares.   Strangely, I can't even figure out how to list who currently has access to each of the AFP SharePoints.   So, looking for command line solution to the following two questions:  1) how to list current users associated to a particular sharepoint? 2) how to add a user to a sharepoint?
8912
Is there a way to avoid anonymous users can see nodes of a content type, like a block or a view?  I can control the access with a view, but if I know the link for a node, I can  see it without first logging in.
112703
My goal is to get the login name and picture for the current user. I am using SharePoint 2013 Foundation. I tried three method and non of then worked correctly:   This is with jQuery SPServices:   function getCurrentUserInfo() {     var thisUsersValues = $().SPServices.SPGetCurrentUser({         fieldNames: ["ID", "Name", "Picture"],         debug: false     });      var name = thisUsersValues["Name"];      var ID = thisUsersValues["ID"];      var SIPAddress = thisUsersValues["Picture"];  }    But I am getting this error:     SCRIPT438: Object doesn't support property or method 'replace'      File: jquery.SPServices-2014.01.js, Line: 2414, Column: 17    REST API method:   function getinfo(loginName) {     var theData = {         "propertiesForUser": {             "__metadata": { "type": "SP.UserProfiles.UserProfilePropertiesForUser" },             "accountName": loginName,             "propertyNames": ["PreferredName", "PictureURL"]         }     };      var requestHeaders = {         "Accept": "application/json;odata=verbose",         "X-RequestDigest": jQuery("#__REQUESTDIGEST").val()     };      jQuery.ajax({         url: _spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertiesFor",         type: "POST",         data: JSON.stringify(theData),         contentType: "application/json;odata=verbose",         headers: requestHeaders,         success: function (data) {             document.getElementById("profilelink").href = userProfileProperties[1];;             document.getElementById("username").innerHTML = userProfileProperties[0];             if (userProfileProperties[1] !== null) {                 document.getElementById("Userprofileimage").src = userProfileProperties[1];             }         },         error: function (jqxr, errorCode, errorThrown) {             console.log(jqxr.responseText);         }     }); }    Error:     "{\"error\":{\"code\":\"-1,        Microsoft.SharePoint.Client.InvalidClientQueryException\",\"message\":{\"lang\":\"en-US\",\"value\":\"The method         GetUserProfilePropertiesFor cannot be invoked as its parameter propertiesForUser is not supported.\"},\"innererror\":        {\"message\":\"The method GetUserProfilePropertiesFor cannot be invoked as its parameter propertiesForUser is not supported.\"        ,\"type\":\"Microsoft.SharePoint.Client.InvalidClientQueryException\",\"stacktrace\":\"     With CSOM:  //SP.SOD.executeOrDelayUntilScriptLoaded(getUserProperties, 'SP.UserProfiles.js'); function getUserProperties(targetUser) {      // get the target users domain name and account name.     var tUser = targetUser.substring(7);     // Get the current client context.     var clientContext = new SP.ClientContext.get_current();     //Get PeopleManager Instance     var peopleManager = new SP.UserProfiles.PeopleManager(clientContext);     // Get the properties to retrieve     var profilePropertyNames = ["PreferredName", "PictureURL"];     var userProfilePropertiesForUser = new SP.UserProfiles.UserProfilePropertiesForUser(         clientContext,         tUser,         profilePropertyNames);     // Get user profile properties for the target user     userProfileProperties = peopleManager.getUserProfilePropertiesFor(userProfilePropertiesForUser);     // Load the UserProfilePropertiesForUser object.     clientContext.load(userProfilePropertiesForUser);     //Execute the Query     clientContext.executeQueryAsync(onRequestSuccess, onRequestFail); }    I really don't understand where the issue is. Does anyone have an idea?
78205
I'm looking to monitor how much bandwidth different users consume on a server.  Effectively, I'm looking for something like UserIPacct (), where I can get a print-out like:      User       Sent       Received     Flags     root       401364     401421     news       2143       2210     lf         221462     348287   Sadly, useripacct is not available for the 2.6 kernel series.
82279
Problem: I want to restrict direct node access using node number www.example.com/node/12 and allow access using pathauto alias www.example.com/content/sometitle to anonymous user. This user should be allowed to see all content of node using only  title path but not with node number to snoof.  Mostly I want to target anonymous users. Admin always has access to everything.   In simple terms, I want to redirect all node/Number paths (not node/add/ContentType) to say the Home page or No Access page.
121096
I'd like to create a popup list on one of my Visualforce pages, for a user to select from a list of OrgWideEmailAddress records.  My goal is to limit the list to only those records that they're allowed to use.  I'm going to save the selection for use in later automatic emails.  Based on what I've read, I won't be able to send emails to certain OrgWideEmailAddresses:   The address hasn't been verified yet.  I don't see any fields in the schema that appear to show verification state. The address is only available to profiles that the user isn't a member of.  I don't see where the profile list is stored for each record.   Some of my problem could just be due to not understanding the standard objects so well, and perhaps there's a way to get at this through UserInfo, or by making my query on the User object which may have a child relationship to OrgWideEmailAddress since it's listed in the schema viewer of the Force.com IDE.  Here's the test code I'm working with:  for (OrgWideEmailAddress addr : [SELECT DisplayName, Address          FROM OrgWideEmailAddress ORDER BY DisplayName]) {     System.debug( addr.DisplayName + ' &lt;' + addr.Address + '&gt;'); }   I tried creating a new Messaging.SingleEmailMessage and then calling setOrgWideEmailAddressId() on it with each OrgWideEmailAddress Id, in hopes that invalid Ids would throw an exception, but to no avail.  My goal is to modify the test code to provide just the subset of records that the current user will be able to use.
34791
This is the announcement post of the Stack Exchange Data Explorer. Its answers were meant to iron out the initial glitches 6 to 8 years ago.  If you have found a bug or need support  today with any of SEDEs features, please ask a new question and tag it with   What does it do? Allows you to run arbitrary SQL queries on the data dumps, and share those queries with your friends. Technical details It is hosted on the Stack Exchange infrastructure , the database is hosted on the same SQL Server version all other sites are hosted on. You can use most of the TSQL commands, even create temporary objects (but not User Defined Functions). The controls used are jQuery based, the grid is  . All query results are cached, so sharing a link to a query will not result in the server going in to a tailspin. The query edit control is a slightly modified  control, I also am considering bespin cause the inter iframe communication is nasty complicated. It gives up nice syntax highlighting for queries. Parameters There is support for parameterized queries, to get it to work name your params like ##this##. For example have a . Query name and description A query can have a name and description, to name it lead with a comment, to describe it continue commenting, for example: -- This is my query name  -- This is my description -- I can span multiple lines  SELECT 1  Anonymous users can initially name a query, but can not change the names of any existing queries. Tutorial There's a  which helps you getting started in writing your own SQL queries. Logging in You can use your openid provider to log in, at the moment once logged in we will track the list of queries you execute (giving you basic history support) Also if there are any params named UserId they will be populated automatically if your EmailHash matches the one on the site being queried. Magic columns If you alias an id column with as [Post Link] it will automatically create a link in the result set to the parent site. Similarly if you alias an id column with as [User Link] it will display a link to the user page. select top 10 * from Posts will show you how tags are done. (Magic columns for images is planned) example (most controversial posts:  ) So what are you waiting for, check it out at  Any feedback would be greatly appreciated. I hope to have the login section working fairly soon and allow voting on the best queries and commenting. Featured Queries At the moment, admins have permission to feature interesting queries on this page , I am looking for better ways to manage the huge query list that is building up.
60521
I gave Google OAuth access to this app that wanted to read Google Analytics API info.   No problem, but now I want to take away that app's permission to read my data.  Where does Google hide these authorized apps so I can remove it?
119406
I was looking at the Community user's profile, and I noticed that there was about 15 sites missing in the "accounts" tab. There's a little over 120 sites on SE, and, there's about 15 sites missing from this count. Why is this happening?    Additionally, clicking on view more just shows one account, on Area51:
19319
I am creating a hosted app in SharePoint. I want to retreive all the custom list from SharePoint and then from the custom lists I want to fetch column values. I got 2 columns with the names title and link. Link is a hyperlink column containing urls. My question is some of my custom lists doesnt have the column name "link" and some has. But I want to retreive those list that has that column. And title column is in every custom list. Some of the list has the column name "link" but with no values.  Error message: 0x800a138f - Runtime errors in JavaScript: Unable to retrieve the property get_url for a reference that is undefined or null      function onSuccessItemFetch() {     // Now you can access the array of SP.ListItemCollection     for (var i = 0, length = listItemsCollection.length; i &lt; length; i++) {         var items = listItemsCollection[i];         var enumerator = items.getEnumerator();          while (enumerator.moveNext()) {             var listItem = enumerator.get_current();             if (typeof listItem.get_item('Link') != "undefined" &amp;&amp; typeof listItem.get_item('Link') != null) {             itemString += listItem.get_item('Title') + "&amp;nbsp" + "&amp;nbsp" + "&amp;nbsp" + "&amp;nbsp" + "&amp;nbsp" + "&amp;nbsp" + "&lt;a href='" + listItem.get_item('Link').get_url() + "'&gt;" + "öppna formulär" + "&lt;/a&gt;" + "&lt;/br&gt;";  //oListItem.get_item('Datum')             $('#divAllaListItems').html(itemString);             }         }     } }   It works fine when I want to retrieve all the custom list titles and the title column values.
109135
I know-know I can search and read but anyway I would need to ask in order to escape possible typos, personal misunderstandings and to better remember.     I develop on a machine with installed Sharepoint 2010 Sever where I have local groups:     Administrators Description: Administrators have complete and unrestricted access to the computer/domain   WSS_Admin_WPG Description: Members of this group have write access to system resources used by Microsoft SharePoint Foundation      **Does the description of "Administrators" ("computer/domain") imply all privileges of "WSS_Admin_WPG" ?    Does the description of **WSS_Admin_WPG (in part of "system resources used by Microsoft SharePoint Foundation") imply Sharepoint Server?**    The WSS_Admin_WPG group has entries of:     "BUILTIN\Administrators (S-1-5-32-544)" group   and some user domain accounts   Is "BUILTIN\Administrators (S-1-5-32-544)" group the same (alias to?) as "BUILTIN\Administrators" entry I observe among Sharepoint Farm Administrators (through "Central Administration")?       Is the entries of domain accounts excessive (or necessary)     in "WSS_Admin_WPG" if these accounts make part of "Administrators" group?     in "Farm Administrators" if these accounts are part of "BUILTIN\Administrators (S-1-5-32-544)" group?     What are relationship (difference) between "BUILTIN\Administrators" and "Administrators"?
16543
I'm currently trying to write a script that displays each group and user in the domain.          Import-Module ActiveDirectory  $Groups = (Get-AdGroup -filter * | Where {$_.name -like "**"} | select name -expandproperty name)  $Table = @()  $Record = [ordered]@{ "Group Name" = ""; "Name" = ""; "Username" = ""; }  Foreach ($Group in $Groups) {  $Arrayofmembers = Get-ADGroupMember -identity $Group | select name,samaccountname  foreach ($Member in $Arrayofmembers) {  $Record.Set_Item("Group Name", $Group)  $Record.Set_Item("Name", $Member.name)  $Record.Set_Item("Username", $Member.samaccountname)  $objRecord = New-Object PSObject -property $Record $Table += $objrecord  }  }  $Table | export-csv "C:\temp\SecurityGroups.csv" -NoTypeInformation   It always returns these errors:  New-Object : A positional parameter cannot be found that accepts argument '+='. At C:\Users\tech\Desktop\list.ps1:17 char:14 + $objRecord = New-Object PSObject -property $Record $Table += $objrecord +              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : InvalidArgument: (:) [New-Object], ParameterBindingException     + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.NewObjectCommand  New-Object : A positional parameter cannot be found that accepts argument '+='. At C:\Users\tech\Desktop\list.ps1:17 char:14 + $objRecord = New-Object PSObject -property $Record $Table += $objrecord +              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : InvalidArgument: (:) [New-Object], ParameterBindingException     + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.NewObjectCommand   Repeating over and over.  Any help would be greatly appreciated!  BTW This is server 2012 R2