Populate a SharePoint Site with Users/Groups from AD - sharepoint

I have created a SharePoint (MOSS 2007) site template, and I am programmatically creating a number of new site based on this template. I would like to populate each site created with this template with a number of users and groups from the Active Directory. Can anyone offer any guidance on how this can be done, either as part of the site template, or through code?
Thanks, MagicAndi.

Have a look at this article, it shows 3 different ways of adding users.
MOSS: Add user to site through code (programmatically)

Related

O365 SharePoint Site - How to replace the default Master Page?

We created an HTML file with Office Fabric UI to make it responsive. Our intention is to integrate the HTML file we created with O365 SharePoint site and make it as our Intranet Home Page.
So, please let us know how to replace the default Master Page with our custom file. Any pointers to appropriate pages would be very helpful.
Account Info: Office 365 Business Essentials with SharePoint Online (Plan 1).
Thanks in advance.
As changes happen on SPO pretty much every week, it might not be a good practice to customize your branding through the master page when you are dealing with SPO. The reason is SPO's master page might be changed based on SPO new release. An alternative solution is to think about custom CSS and JavaScript injection through SharePoint CustomAction. You can reference PnP Partner Pack for site collection provisioning sample with responsive design.
If you really need to custom master page, you probably follow the exactly same way as SharePoint 2013 on premise environment to upload your master page and page layout. You can reference to How to: Convert an HTML file into a master page in SharePoint 2013 for detail information.

Sharepoint Requirement Login?

I am setting up a SharePoint Online instance and I have some requirements that I do not know how to implement.
These are some of the requirements:
When a user logs into SharePoint, the user should select a country and city. Depending on the selected country and city, the corresponding site and subsites should appear.
Create folders that users cannot delete.
I don't know what is the process to create the first point and the option to disable in the second, if some of you know a tutorial or maybe knows how to do it, I would really appreciate it.
(1) One approach is modifying the welcome page through SharePoint Designer to contain HTML selectors for country and city. Based on the selected country and city, you can then redirect to the proper site using JavaScript.
(2) Creating folders that users can't delete requires custom .NET code. You can't run custom .NET code directly in SharePoint Online. Depending on your requirements, you need to create the folders using a console application or a custom app part. The console app or the app part can create the folders and remove permissions on the folders.

How can I make a column editable only to a few users in SharePoint?

I want to create a couple of columns in a doc library, which should be editable only for a few users. These users can be part of a single group. However currently, this is editable by all users and does not serve my purpose.
My SP site is created using WSS 3.0 and workflows are built using SP designer.
There is an interesting codeplex project (SPListDisplaySetting) which will fit your needs, I think?!

Sharepoint usage statistics across all sites in collection?

Is there a way of getting usage statisics across my whole Sharepoint 2007 portal?
I can get the figures at a site level by appending _layouts/SpUsageWeb.aspx
to the path, i.e. http://intranet/teams/hr/_layouts/SpUsageWeb.aspx for the HR page or http://intranet/_layouts/SpUsageWeb.aspx for the front page.
What I'm trying to do is see how many unique users access the portal (across all the sites it contains). Using the above method on each site and summing the total users for each doesn't take into account users who visit more than one site.
I've seen commercial tools that seem to do this but surely there has to be built in functionality that does this for a product as all-singing-and-dancing as Sharepoint?
The URL of the site collection statistics page is http://intranet/_layouts/SpUsageSite.aspx.
This functionality does not exist in SharePoint 2007. It was added to SharePoint 2010. You can now report on stats in central admin for web applications etc.

Adding a custom tab and page MOSS MySites that everyone can see

On MOSS mysites I want to be able to create a new tab that every mysite user can view, it should show a web part page.
How can I do this?
Create a site collection as a parent to all the MySites. Or to put it the other way, make the MySites a subsite to a site collection that has the site that you want all the MySites to see.
In your Shared Services Provider (Central Admin/Shared Services Admin), look under User Profiles and My Sites. You can select Personalization Site Links and point to an existing site that contains the web part page you want to display.
You can also filter the display using the Audiences functionality so that it only displays to a select group of users.
In regards to #Brian Meinertz's comment. This a detailed blog on Microsft's site about feature stapling:
Customizing MOSS 2007 My Sites within the enterprise

Resources