Tuesday, December 22, 2015

SharePoint 2013–Update password of a managed account using PowerShell

We can change the password of a SharePoint managed account from SharePoint central administration console as well as using PowerShell.

Fun fact here is that, we don’t need to do anything from our Domain Controller. When we update the password either from Central Administration or PowerShell, it will automatically update the user’s password in Active Directory.

Update managed account password in Central Administration

image

image

Update managed account password using PowerShell

Set-SPManagedAccount -identity SP\SP_Farm -NewPassword (Convertto-Securestring "mynewpassword" -AsPlainText -Force) -SetNewPassword

Thursday, December 10, 2015

Set home directories for multiple clients in CygWin SFTP–Windows Server 2012 R2

In one of my SharePoint environments, we have a file server configured with SFTP. SFTP is used to securely transfer content from each user using their comfortable FTP clients. Those content will later be processed by custom tool and uploaded to analysis server for data analysis.

We have configured SFTP using CygWin.

The environment need to support multiple clients where each client has multiple users. Following were some requirements

  • Separate drive (“F”) to store uploaded content
  • Each client should have a folder under SFTP root data directory
  • Each user should have a separate folder under his client
  • Specific user can interact with his own content only
  • Specific user can’t view other users folders

Following were the steps I used to configure home directories and their permissions

1. Create domain user groups in Domain Controller

image7

image9


2. Add users to respective user groups (clients)

image14

image20

3. Perform configurations in SFTP to specify home directories for each client

    • Navigate to /etc/fstab file
    • Specify home directories as given below

image

4. Open CygWin Shell and execute following commands to obtain user information

image30

5. Change home directories of users in /etc/passwd file as shown below

image39

6. Create home directories in F drive and create folders for each client

image

7. Create sub folders for each users within the client

image

8. Deny permissions for SFTP user groups in CygWin root directory

image53

image59

9. Deny permission for SFTP user groups in SFTP root directory (F:/FTP)

image69

10. Now we need to provide permission to specific user folders. We need to disable permission inheritance as shown below

image74

image79

image

image89

image96

image101

image105

11.  Check using FTP client

image

If we try to browse the directory in client level, an error message will be displayed

image

That is the expected behavior. that means the a specific user can interact with his own content only.