Guest User

Test Code to reproduce truncated strings

a guest
Jun 27th, 2011
96
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         creds = credentials.Credentials()
  2.         creds.set_username("administrator")
  3.         creds.set_password("something")
  4.         creds.set_workstation("")
  5.         creds.set_domain("")
  6.        
  7.  
  8.         conn = srvsvc.srvsvc('ncalrpc:', credentials=creds)
  9.    
  10.         ctr = srvsvc.NetShareInfoCtr()
  11.         ctr.level = 502
  12.        
  13.         (list, total, resume) = conn.NetShareEnumAll(None, ctr, -1, None)
  14.  
  15.         shares_list = []
  16.      
  17.         for share in list.ctr.array:
  18.             print share.name
RAW Paste Data