Sharepoint site privacy settings though code - sharepoint

I have stressed all morning regarding this minor issue.
I have x sharepoint sites, some of them are public some of them are private.
I want to be able to modify the privacy settings through code, but so far I have only been able to do it manually.
I can set the field if I create the site anew, but I have not managed to do it if the site already exists.
I have also looked into: https://learn.microsoft.com/en-us/powershell/module/sharepoint-pnp/?view=sharepoint-ps, but have not found a commandlet to update this.
[1]: https://i.stack.imgur.com/STxfz.png

Answer:
I finally managed to get this to work using the
_api/SP.Directory.DirectorySession/Group(id) endpoint.
I could not find official documentation though, and had to do it by moniting the network traffic

Related

SharePoint Office365 - how to give access to internal websites

This has somewhat being answered here, but it's very outdated and the links given do not apply, at least the 2nd link.
We have a full license for Office 365 Sharepoint and I want to be able to create a web-part (Page-Viewer) to place an internal hosted website in an iframe.
For some reason the web-part has greyed-out the Zone and I cannot change it to Left or anything else. Why?
Is it possible to allow external users to access our Intranet and internal websites via Sharepoint and how please?
Another one of those, "I should have looked further", for the answer!
https://support.office.com/en-us/article/turn-external-sharing-on-or-off-for-sharepoint-online-6288296a-b6b7-4ea4-b4ed-c297bf833e30
https://support.office.com/en-us/article/manage-external-sharing-for-your-sharepoint-online-environment-c8a462eb-0723-4b0b-8d0a-70feafe4be85
The features are there and available on Office365 to turn ON or OFF sharing of internal areas to external users. However, it is risky, not knowing really who's watching over the shoulders of people.

Azure - Creation of web site 'null' failed

I finally decided to give Azure a try and the first thing I do - creating a simple web site - fails with: Creation of web site 'null' failed. Details say: Provisioning failed.
I am simply trying to "quick create" a simple website. Researching the Web, I see other people with the same problem, but no real solution.
I do have an active "Visual Studio Ultimate with MSDN" subscription and $150 of unexpired credits.
I must be missing something very fundamental.
Seems to be known issue:
A number of users have experienced “Provisioning Failed” errors when
attempting to deploy Windows Azure Websites. This is a known issue
with the trial version, and there is an active discussion thread on
the MSDN forums here.
It is expected that this is a temporary problem that will be fixed
soon, in the meantime there are a few things you can try: Ensure
database passwords do not contain special characters like ', ", =,
etc. Try creating a website without a database, database creation may
be causing the error. Try deploying the site in a few hours, it may be
a temporary problem in the data center.
So, to put some closure on this, I contacted Microsoft Support and they suggested trying to login to the portal through an anomymous/incognito browser session. Once I did that, I was able to create a website.
Mind you, having cleared all persistent data (cookies, etc.) in the regular browser, I still cannot do anything in Azure, from several different machines. But at least the incognito session is a workable workaround.

How to mirror Sharepoint 2007 site?

I'm not sure if this should be posted here or over superuser, but how does one go about mirroring a Sharepoint 2007 site? I have admin access, and the mirror doesn't need to be nice and pretty; it just needs to be presentable and readable. Also, I need all the shared docs to be copied as well.
We use to have WinHTTrack to mirror the Sharepoint, but that broke a few months ago due to some of our recent security changes. I tried the username#password:domain method but that resulted no luck.
It depends a little bit on how and where you want to mirror it.
If you have a separate SharePoint farm (even a single server - one tier - farm), you can rely on backup / restore, export / import or content deployment to have another copy up and running that will be a mirror of the existing one.
If you want an offline version, depends on what kind of content you need (collaboration stuff ?) you can use Microsoft Groove 2007 that offers an offline mode for some of the targeted data.
I've found this great tool that can mirror the SP site for cheap: http://www.metaproducts.com/OEPR.html
If WinHTTrack did satisfy you, why not just fix it?
There are solutions around the web to have WinHTTrack work with NTLM authentication: http://forum.httrack.com/readmsg/7513/index.html
However the download link seems to be broken (geocities..), but you could try to search for NTML proxy solutions and try to setup your own.

Holding Page during SharePoint Upgrade?

We'll be upgrading a client's MOSS public internet site soon from a Cumulative Update to SP2 and are conscious that there will be downtime (to perform the upgrade and possibly troubleshooting!). We would like to add a holding page so that visitors still get access to key contact details and a message that the site is under maintenance.
Does anyone have any tips for doing this type of thing with SharePoint? I know of the app_offline.htm file that when dropped into the web root, will automatically prevent access to the rest of the site but wasn't sure if this was standard practice in the SharePoint world?
Any tips?
Cheers, James.
If the app_offline.htm works for you, then by all means, use it.
I think that it will the best option for you, and to the best of my knowledge SharePoint doesn't have any other means of putting itself offline.
As this is a public intranet site you are updating, presumably there is already a test environment for it that is close or the same in configuration. It is important to follow exactly the same steps for updating the test environment as you would for production. These should be documented as well and followed to the letter to reduce the likelihood of mistakes. This way you are much less likely to run into problems.
I would try app_offline.htm as you suggest (like Magnus I don't believe there is another way to take SharePoint offline). If your test environment updates with this in place you should be fine.

Delete a Web that doesn't exist

While setting up a test environment I was attempting to set up many different types of sites for testing various things when I ran into a strange bug in SharePoint.
I was creating a subsite under a blank site template and saw the option for "News Site" so I selected it and got an error saying that the Publishing Feature was not enabled at the site collection level.
Fine. So, I went and activated it and then attempted to create the site again and I got the error:
The Web site address "/mpsite/news" is already in use
Ok, so the site must have been created anyway so I try to visit the URL and get:
The webpage cannot be found
Fine. So, obviously it errored in the middle of the site creation so I'll just delete it via STSADM. Wrong:
There is no top-level Web site named "http://server/mpsite/news/".
So, the site is listed in the sites and workspaces list, but doesn't really exist and can't actually be deleted.
How do I get rid of it from the Sites and Workspaces listing?
You've run into one of the lovely undocumented "features" of SharePoint - site templates get applied after the site gets created in a seperate, descrete step. This means that potentially, a site can "exist" (as far as the content database is concerned) without template, which leaves you with a site you can't browse to, but still sorta "exists" in SharePoint purgatory (I've actually written a couple of hacks that involve relying on this "feature").
It looks to me like you may have run into one such situation - when you went to go create your site, I'm guessing that you got the error before the template was applied to your news site.
The way I've fixed similar problems in the past has been to use SharePoint Designer to delete the sites - since it looks straight into the content database for what does and doesn't exist, it might do the trick for deleting your rouge news site.
Hope this helps!
Have you tried http://server/mpsite/news/_layouts/deleteweb.aspx ?
Or maybe the "Content and structure" (http://server/mpsite/_layouts/sitemanager.aspx) link from site actions?
I know this is old, but it may help somebody. In SP2013 running the Remove-SPWeb Powershell command with the url of the corrupted web worked perfectly for me.

Resources