Skip to main content

Posts

FTP C# Error : “The remote server returned an error: (530) Not logged in ."

  Recently working on a FTP solution using C# , i encountered an error  “ The  remote server returned an error: (530) Not logged in.” The code i used was following: FtpWebRequest request = (FtpWebRequest)WebRequest.Create( ftp://xxxxxx/file.txt ); request.Method = WebRequestMethods.Ftp.UploadFile request.Credentials = new NetworkCredential(usernameVariable, passwordVariable); What was more bewildering was if i modified the code to following, the solution was working fine. But this for obvious reasons is not an option as the username cannot be hardcoded //works but implausible to use in realtime solutions request.Credentials = new NetworkCredential("dmn/#gsgs", password);  Some googling revealed that special charcters create issues in the NetworkCredential Object. Hence some playing around worked for me, and it works irrespective of wether i do a FTPWebRequest or WebRequest. Solution: Instantiate NetworkCredential object with three paramters (username, password, domain) and m

SharePoint MySite – PowerShell script to get the “Activities I am following” preferences

 So I was asked to collect the preferences of “Activities I am following” (image below) for all the users of our SP2010 My Site. The resources on web for this being  surprisingly limited , I was left with no other option but to turn to my cup of coffee  for solution . The coffees helped, the following script lists out the status of options available under “Activities I am following ” of My Site Edit Profile page in SharePoint 2010 , for each user. $mySiteURL = "https://xxxx" $site = Get-SPSite $mySiteURL $context = Get-SPServiceContext $site; $upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context); $val = "Username,ActivityName,Value" Add-content -path "d:activity_preference.txt" -value $val foreach ($profileupm in $upm.GetEnumerator()) { $myprofile = $profileupm; $usrprofile = $profileupm; $am = New-Object Microsoft.Office.Server.ActivityFeed.ActivityManager($myprofile, $context) $type = $am.GetType() $methodIn